MEMORY SYSTEM OF AN ARTIFICIAL NEURAL NETWORK BASED ON A DATA LOCALITY OF AN ARTIFICIAL NEURAL NETWORK

Information

  • Patent Application
  • 20220138586
  • Publication Number
    20220138586
  • Date Filed
    October 12, 2021
    3 years ago
  • Date Published
    May 05, 2022
    2 years ago
  • Inventors
  • Original Assignees
    • DEEPX CO., LTD.
Abstract
A memory system of an artificial neural network (ANN) includes a processor configured to process an ANN model; and an ANN memory controller configured to control a rearrangement of data of the ANN model stored in a memory and to operate the data of the ANN model stored in the memory in a read-burst mode based on ANN data locality information of the ANN model. The ANN memory controller may receive pre-generated ANN data locality information, or the processor may generate a plurality of data access requests sequentially so that the ANN memory controller may generate the ANN data locality information by monitoring the plurality of data access requests. The ANN memory controller prepares, based on an artificial neural network data locality, data before receiving a request from the processor in order to reduce a delay in the data supply of the memory to the processor.
Description
CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the priority of Korean Patent Application No. 10-2020-0144308 filed on Nov. 2, 2020 and Korean Patent Application No. 10-2021-0044772 filed on Apr. 6, 2021, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein by reference.


BACKGROUND OF THE DISCLOSURE
Technical Field

The present disclosure relates to an artificial neural network memory system based on a data locality of an artificial neural network, and more particularly, to an artificial neural network memory system capable of preparing data before receiving a request from a processor, based on an artificial neural network data locality.


Background Art

As an artificial intelligence inference ability is developed, various inference services such as sound recognition, voice recognition, image recognition, object detection, driver drowsiness detection, dangerous moment detection, and gesture detection are mounted in various electronic devices such as artificial intelligence speakers, smart phones, smart refrigerators, VR devices, AR devices, artificial intelligence CCTVs, and artificial intelligence (AI) robot cleaners, tablets, notebook computers, autonomous vehicles, bipedal robots, quadrupedal robots, and industrial robots.


Recently, as the deep learning technique is developed, a performance of an artificial neural network inference service by big-data-based learning is developed. The learning and inference services of the artificial neural network repeatedly train the artificial neural network with a vast amount of learning data and infer various and complex data by means of the trained artificial neural network model. Accordingly, various services are provided to the above-mentioned electronic devices by utilizing the artificial neural network technique.


However, a function and an accuracy required for the inference service which utilizes the artificial neural network are gradually being increased. Accordingly, a size of the artificial neural network model, a computational amount, and a size of learning data are exponentially increased. A performance required for the processor and the memory, which are capable of handling the inference operation of the artificial neural network model, is gradually increased. Also, an artificial neural network inference service is actively provided to a cloud computing-based server which easily handles the big data.


In the meantime, edge computing which utilizes the artificial neural network model technique is actively being studied. The edge computing refers to an edge or a peripheral portion where the computing is performed. The edge computing refers to a terminal which directly produces data or various electronic devices located to be adjacent to the terminal. The edge computing is also referred to as an edge device. The edge device may be utilized to immediately and reliably perform necessary tasks such as those of autonomous drones, autonomous robots, or autonomous vehicles which need to process a vast amount of data within 1/100th of a second. Accordingly, fields to which the edge device is applicable are rapidly increasing.


SUMMARY OF THE DISCLOSURE

The inventor of the present disclosure has recognized that operation of a conventional artificial neural network model had problems, such as high power consumption, heating, and a bottleneck phenomenon of a processor operation due to a relatively low memory bandwidth and a memory latency. Accordingly, the inventor has further recognized that there were various difficulties to improve the operation processing performance of the artificial neural network model and that an artificial neural network memory system which is capable of improving the problems needed to be developed.


Therefore, the inventor of the present disclosure studied an artificial neural network (ANN) memory system which is applicable to a server system and/or edge computing. Moreover, the inventor of the present disclosure also studied a neural processing unit (NPU) or a neural network processing unit which is a processor of an ANN memory system optimized for processing an artificial neural network (ANN) model.


First, the inventor of the present disclosure has recognized that in order to improve the computational processing speed of the artificial neural network, the key point was to effectively control the memory during the computation of the artificial neural network model. The inventor of the present disclosure has recognized that when the artificial neural network model is trained or inferred, if the memory is not appropriately controlled, necessary data is not prepared in advance so that reduction in the memory effective bandwidth and/or delay of the data supply of the memory may frequently occur. Further, the inventor of the present disclosure has recognized that, in this case, a starvation or idle state in which the processor is not supplied with data to be processed is caused so that an actual operation cannot be performed, which results in the degradation of the operation performance.


Second, the inventor of the present disclosure has recognized a limitation of the operation processing method of the artificial neural network model at an algorithm level of a known art. For example, a known prefetch algorithm is a technique which analyzes the artificial neural network models in a conceptual layer unit so that the processor reads data from the memory in each layer unit. However, the prefetch algorithm cannot recognize an artificial neural network data locality in the word unit or a memory access request unit of the artificial neural network model existing at a processor-memory level, that is, a hardware level. The inventor of the present disclosure has recognized that it is difficult to optimize the data transmitting/receiving operation at the processor-memory level only by the prefetch technique.


Third, the inventor of the present disclosure has recognized an “artificial neural network data locality” which is a unique characteristic of the artificial neural network model. The inventor of the present disclosure has recognized that there is an artificial neural network data locality in the word unit or the memory access request unit at the processor-memory level and that the effective memory bandwidth is maximized and the latency of the data supplying to the processor is minimized by utilizing the artificial neural network data locality to improve the artificial neural network learning/inference operation processing performance of the processor.


Specifically, the “artificial neural network data locality” of the artificial neural network model recognized by the inventor of the present disclosure refers to sequence information of the word unit of data required to computationally process the artificial neural network by a processor which is performed in accordance with the structure of the artificial neural network model and the operation algorithm when the processor processes a specific artificial neural network model. Moreover, the inventor of the present disclosure has recognized that in the operation processing sequence of the artificial neural network model, an artificial neural network data locality is maintained for the operation of the iterative learning and/or inference for the artificial neural network model given to the processor. Accordingly, the inventor of the present disclosure has recognized that when the artificial neural network data locality is maintained, the processing sequence of the data required for the artificial neural network operation processed by the processor is maintained in the word unit and the information is provided or analyzed to be utilized for the artificial neural network operation. In other words, the word unit of the processor may refer to an element unit which is a basic unit to be processed by the processor. For example, when a neural processing unit processes the multiplication of N-bit input data and M-bit kernel weight, an input data word unit of the processor may be N bits and a word unit of the weight data may be M bits. Further, the inventor of the present disclosure has recognized that the word unit of the processor may be set to be different depending on a layer, a feature map, a kernel, an activation function, and the like of the artificial neural network model, respectively. Accordingly, the inventor of the present disclosure also has recognized that a precise memory control technique is necessary for the operation in the word unit.


The inventor of the present disclosure noticed that, when the artificial neural network model is compiled by a compiler to be executed in a specific processor, the artificial neural network data locality is constructed. Further, the inventor has recognized that the artificial neural network data locality may be constructed in accordance with an operation characteristic of the algorithms applied to the compiler and the artificial neural network model, and the architecture of the processor. In addition, the inventor of the present disclosure has recognized that, even in the same artificial neural network model, the artificial neural network data locality of the artificial neural network model to be processed may be constructed in various forms depending on a computing method of the artificial neural network model of the processor, for example, feature map tiling, the stationary technique of a processing element, the number of processing elements of a processor, a feature map in the processor, a cache memory capacity such as a weight, a memory layered structure in the processor, or an algorithm characteristic of a compiler which determines a sequence of a computational operation of the processor to compute the artificial neural network model. This is because even though the same artificial neural network model is computed, the processor may determine the sequence of data necessary at every moment in the clock unit to be different due to the above-mentioned factors. That is, the inventor of the present disclosure has recognized that the sequence of the data necessary for the computation of the artificial neural network model is conceptually the computational sequence of the layers of the artificial neural network, unit convolution, and/or matrix multiplication. Moreover, the inventor of the present disclosure has recognized that in the sequence of data required for physical computation, the artificial neural network data locality of the artificial neural network model is constructed in the word unit at a processor-memory level, that is, a hardware level. Further, the inventor of the present disclosure has recognized that the artificial neural network data locality depends on a processor and a compiler used for the processor.


Fourth, the inventor of the present disclosure has recognized that when an artificial neural network memory system constructed to be supplied with the artificial neural network data locality information to utilize the artificial neural network data locality is provided, the processing performance of the artificial neural network model may be maximized at the processor-memory level.


The inventor of the present disclosure has recognized that when the artificial neural network memory system precisely figures out the word unit of the artificial neural network data locality of the artificial neural network model, the processor also finds operation processing sequence information of the word unit which is a minimum unit by which the processor processes the artificial neural network model. That is, the inventor of the present disclosure has recognized that when the artificial neural network memory system which utilizes the artificial neural network data locality is provided, the artificial neural network memory system may precisely predict whether to read specific data from the memory at a specific timing to provide the specific data to the processor or whether the specific data is to be computed by the processor to store the specific data in the memory at a specific timing, in the word unit. Accordingly, the inventor of the present disclosure has recognized that the artificial neural network system is provided to prepare data to be requested by the processor in the word unit in advance.


In other words, the inventor of the present disclosure has recognized that, if the artificial neural network memory system knows the artificial neural network data locality, when the processor calculates a convolution of the specific input data and a specific kernel using a technique such as feature map tiling, the operation processing sequence of the convolution which is processed while the kernel moves in a specific direction is also known in the word unit.


That is, it was recognized that the artificial neural network memory system predicts which data will be necessary for the processor by utilizing the artificial neural network data locality, so that a memory read/write operation to be requested by the processor is predicted and data to be processed by the processor is prepared in advance to minimize or eliminate the memory effective bandwidth increase and/or the data supply latency of the memory. Further, the inventor has recognized that when the artificial neural network memory system supplies data to be processed by the processor at a necessary timing, the starvation or idle state of the processor may be minimized. Accordingly, the inventor of the present disclosure has recognized that the operation processing performance may be improved and the power consumption may be reduced by the artificial neural network memory system.


Fifth, the inventor of the present disclosure has recognized that, even though an artificial neural network memory controller may not be provided with artificial neural network data locality information, after disposing the artificial neural network memory controller in a communication channel between a processor which is processing the artificial neural network model and the memory, when the processor processes the operation of the specific artificial neural network model, a data access request to the memory is analyzed to infer the artificial neural network data locality of the artificial neural network model which is being processed by the processor in the data access request unit between the processor and the memory. That is, the inventor of the present disclosure has recognized that each artificial neural network model has a unique artificial neural network data locality, so that the processor generates the data access request in a specific sequence according to the artificial neural network data locality at the processor-memory level. Further, the inventor of the present disclosure has recognized that the access queue of data stored in the memory for data request between the processor and the memory based on the fact that the artificial neural network data locality is maintained while the processor iteratively processes the learning/inference operation of the artificial neural network model.


Therefore, the inventor of the present disclosure disposed the artificial neural network memory controller in a communication channel of the processor which was operating the artificial neural network model and the memory. Further, the inventor observed the data access request between the processor and the memory for one or more learning and inference operations to recognize that the artificial neural network memory controller may infer the artificial neural network data locality in the data access request unit. Accordingly, the inventor of the present disclosure has recognized that, even if the artificial neural network data locality information is not provided, the artificial neural network data locality may be inferred by the artificial neural network memory controller.


Therefore, the inventor of the present disclosure has recognized that the memory read/write operation to be requested by the processor based on the artificial neural network data locality which is reconstructed in the data access request unit can be predicted and that the memory effective bandwidth increase and/or the memory data supply latency may be minimized or substantially eliminated by preparing data to be processed by the processor in advance. Further, the inventor of the present disclosure has recognized that, when the artificial neural network memory system supplies data to be processed by the processor at a necessary timing, the starvation or idle state occurrence rate of the processor may be minimized.


Accordingly, an object to be achieved by the present disclosure is to provide an artificial neural network (ANN) memory system which optimizes an artificial neural network operation of a processor by utilizing an artificial neural network (ANN) data locality of an artificial neural network (ANN) model which operates at a processor-memory level.


Therefore, according to an aspect of the present disclosure, there is provided a memory system of an artificial neural network (ANN). The memory system may include a processor configured to process an ANN model; and an ANN memory controller configured to control a rearrangement of data of the ANN model stored in a memory, and operate the data of the ANN model stored in the memory in a read-burst mode based on ANN data locality information of the ANN model.


The ANN memory controller may be further configured to receive pre-generated ANN data locality information.


The processor may be further configured to generate a plurality of data access requests sequentially, and the ANN memory controller may be further configured to generate the ANN data locality information by monitoring the plurality of data access requests.


The ANN memory controller may be further configured to control communication between the processor and the memory in which the data of the ANN model is stored.


The ANN memory controller may be further configured to rearrange the data of the ANN model stored in the memory in a forward direction based on the ANN data locality information.


The processor may be further configured to generate a plurality of data access requests sequentially, each of the plurality of data access requests including a memory address of the memory, and the ANN memory controller may be further configured to rearrange the data of the ANN model by monitoring the memory addresses of the plurality of data access requests.


According to another aspect of the present disclosure, there is provided a memory system of an artificial neural network (ANN). The memory system may include a processor configured to generate a data access request for processing a neural network model; an ANN memory controller configured to generate a memory access request corresponding to the data access request based on ANN data locality information of the ANN model; and a memory configured to provide data corresponding to the memory access request to the ANN controller in a read-burst mode based on the ANN data locality information.


The processor may be further configured to generate a plurality of data access requests sequentially, and the ANN memory controller may be further configured to determine whether the plurality of data access requests are operable in the read-burst mode based on memory addresses of the memory corresponding to the plurality of data access requests. If it is determined that the memory cannot operate in the read-burst mode, the ANN memory controller may be further configured to store data corresponding to the plurality of data access requests in memory addresses of the memory, the memory addresses enabling the read-burst mode. The memory addresses of the memory may include a first memory address corresponding to a data access request of the plurality of data access requests and a second memory address enabling operation of the read-burst mode, and the ANN memory controller may be further configured to exchange data stored in the first memory address and data stored in the second memory address.


The ANN memory controller may be further configured to set a specific memory area of the memory for the read-burst mode based on the ANN data locality information.


According to another aspect of the present disclosure, there is provided a memory system of an artificial neural network (ANN). The memory system may include a processor configured to process an ANN model; at least one memory configured to store data of the ANN model; and an ANN memory controller configured to increase an operation rate in a read-burst mode of the data stored in the at least one memory by analyzing a continuity of memory addresses of sequential memory access requests generated based on ANN data locality information of the ANN model.


The ANN memory controller may include a cache memory, and the cache memory may be configured to store a weight value corresponding to the ANN data locality information of the ANN model.


The at least one memory may include a plurality of memories, and the ANN memory controller may be further configured to distribute and store the data of the ANN model in the plurality of memories.


The ANN memory controller may be further configured to control a refresh timing of a specific global bit line of the at least one memory, based on the ANN data locality information of the ANN model and a memory address at which the data of the ANN model is stored.


The ANN memory controller may be further configured to obtain mapping data in which memory access requests corresponding to data access requests generated by the processor are mapped to each other based on the ANN data locality information.


The ANN memory controller may be further configured to rearrange the data of the ANN model stored in the at least one memory based on the ANN data locality information.


The at least one memory may include a volatile or a non-volatile memory having the read-burst mode.


The ANN memory controller may be further configured to rearrange the data of the ANN model stored in the at least one memory so as to optimize for the read-burst mode, based on the ANN data locality information of the ANN model, and update the ANN data locality information of the ANN model to correspond to the rearranged data.


According to the examples of the present disclosure, in the system which processes the artificial neural network, the delay of the data supply of the memory to the processor may be substantially removed or reduced by the artificial neural network data locality.


According to the examples of the present disclosure, the artificial neural network memory controller may prepare data of the artificial neural network model which is processed at a processor-memory level before being requested by the processor.


According to the examples of the present disclosure, the learning and inference operation processing time of the artificial neural network model which is processed by the processor is shortened to improve the operation processing performance of the processor and to improve the power efficiency for the operation processing at the system level.


The effects according to the present disclosure are not limited to the contents exemplified above, and more various effects are included in the present specification.





BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1A is a schematic block diagram of an artificial neural network memory system according to an example of the present disclosure.



FIG. 1B is a schematic diagram illustrating an exemplary neural processing unit for explaining reconstruction of an artificial neural network data locality pattern which is applicable to various examples of the present disclosure.



FIG. 2 is a diagram for explaining an artificial neural network data locality pattern according to an example of the present disclosure.



FIG. 3 is a schematic diagram illustrating an exemplary artificial neural network model for explaining an artificial neural network data locality pattern which is applicable to various examples of the present disclosure.



FIG. 4 is a schematic diagram for explaining an artificial neural network data locality pattern generated by analyzing the artificial neural network model of FIG. 3 by an artificial neural network memory controller according to an example of the present disclosure.



FIG. 5 is a diagram for explaining a token and identification information corresponding to the artificial neural network data locality pattern of FIG. 4.



FIG. 6 is a diagram for explaining a predicted data access request and a subsequent data access request generated based on an artificial neural network data locality pattern by an artificial neural network memory controller according to an example of the present disclosure.



FIG. 7 is a flowchart of an operation of an artificial neural network memory controller according to an example of the present disclosure.



FIG. 8 is a schematic block diagram of an artificial neural network memory system according to another example of the present disclosure.



FIG. 9 is a schematic diagram of an operation of a memory system according to a comparative embodiment of the present disclosure.



FIG. 10 is a schematic diagram of an operation of the memory system of FIG. 8.



FIG. 11 is a schematic block diagram of an artificial neural network memory system according to still another example of the present disclosure.



FIG. 12 is a diagram of exemplary identification information of a data access request.



FIG. 13 is a diagram for explaining energy consumption per unit operation of an artificial neural network memory system.



FIG. 14 is a schematic diagram for explaining an artificial neural network memory system according to various examples of the present disclosure.



FIG. 15A is a schematic diagram illustrating an artificial neural network memory system according to various examples of the present disclosure.



FIG. 15B is a schematic diagram of the SFU of FIG. 15A.



FIG. 16 is an exemplary diagram illustrating the structure and operation of the DRAM as the main memory of FIG. 15A.



FIG. 17 shows an architecture of a system according to the first example.



FIG. 18 shows an architecture of a system according to the second example.



FIG. 19 shows an architecture of a system according to the third example.



FIG. 20 shows an architecture of a system according to the fourth example.



FIG. 21 shows an architecture of a system according to the fifth example.



FIG. 22 shows an architecture of a system according to the sixth example.



FIG. 23 is an exemplary diagram illustrating an example of data when Mobilenet V1.0 is used as an artificial neural network model.



FIG. 24 shows an example of performing an operation after caching data from the main memory to the buffer memory.



FIG. 25 shows another example of caching data from the main memory to the cache memory and then performing an operation according to a tiling technique.



FIG. 26 shows an example of rearranging data in the main memory.



FIG. 27 is an exemplary view showing an address system of the main memory for the operation of the NPU.



FIG. 28 shows an example in which the AMC controls the burst operation of the main memory based on the ANN data locality information.



FIG. 29 is an exemplary diagram illustrating an example of a method of mapping an address of a main memory based on the ANN data locality information.



FIG. 30 is an exemplary diagram illustrating another example of a method of mapping an address of a main memory based on the ANN data locality information.



FIG. 31 is a graph comparing the bandwidth of the data bus between the buffer memory (cache) and the main memory.



FIG. 32 is an exemplary diagram illustrating an architecture including a compiler.





DETAILED DESCRIPTION OF THE EMBODIMENT

Advantages and characteristics of the present disclosure and a method of achieving the advantages and characteristics will be clear by referring to various examples described below in detail together with the accompanying drawings. However, the present invention is not limited to an example disclosed herein but will be implemented in various forms. The examples are provided to enable the present invention to be completely disclosed and the scope of the present invention to be easily understood by those skilled in the art. Therefore, the present invention will be defined only by the scope of the appended claims.


Detailed description of the present disclosure may be described with reference to the drawings for the convenience of description with specific example by which the present disclosure can be carried out as an example. Although components of various examples of the present disclosure are different from each other, manufacturing methods, operating methods, algorithms, shapes, processes, structures, and characteristics described in a specific example may be combined with or included in other embodiments. Further, it should be understood that a position or a placement of an individual constituent element in each disclosed example may be changed without departing from the spirit and the scope of the present disclosure. The features of various embodiments of the present disclosure can be partially or entirely bonded to or combined with each other and can be interlocked and operated in technically various ways which are understandable by those skilled in the art, and the embodiments can be carried out independently of or in association with each other.


The shapes, sizes, ratios, angles, numbers, and the like illustrated in the accompanying drawings for describing the examples of the present disclosure are merely examples, and the present disclosure is not limited thereto. Like reference numerals indicate like elements throughout the specification. Further, in the following description, a detailed explanation of known related technologies may be omitted to avoid unnecessarily obscuring the subject matter of the present disclosure. The terms such as “including,” “having,” and “consist of” used herein are generally intended to allow other components to be added unless the terms are used with the term “only.” Any references to singular may include plural unless expressly stated otherwise. Components are interpreted to include an ordinary error range even if not expressly stated. When the position relation between two parts is described using the terms such as “on,” “above,” “below,” “next to,” or “adjacent to,” one component may be positioned between the two components unless the terms are used with the term “immediately” or “directly,” When an element or layer is disposed “on” another element or layer, another layer or another element may be interposed directly on the other element or therebetween.



FIG. 1A illustrates an artificial neural network memory system 100 based on an artificial neural network data locality according to an example of the present disclosure.


Referring to FIG. 1A, the artificial neural network memory system 100 may be configured to include at least one processor 110 and at least one artificial neural network memory controller 120. That is, at least one processor 110 according to the examples of the present disclosure is provided, and a plurality of processors may be utilized. Meanwhile, at least one artificial neural network memory controller 120 according to the examples of the present disclosure is provided, and a plurality of artificial neural network memory controllers may be utilized.


Hereinafter, for the convenience of description, when the at least one processor 110 includes just one processor, it may be referred to as a processor 110.


Hereinafter, for the convenience of description, when the at least one artificial neural network memory controller 120 includes just one artificial neural network memory controller 120, it may be referred to as an artificial neural network memory controller 120.


The processor 110 is configured to process an artificial neural network model. For example, the processor 110 processes inference of an artificial neural network model which is trained to perform a specific inference function to provide an inference result of the artificial neural network model in accordance with the input data. For example, the processor 110 processes the learning of the artificial neural network model for performing a specific inference function to provide a trained artificial neural network model. The specific inference function may include various inference functions which may be inferred by the artificial neural network, such as object recognition, voice recognition, and image processing.


The processor 110 may be configured to include at least one of a central processing unit (CPU), a graphic processing unit (GPU), an application processor (AP), a digital signal processing device (DSP), an arithmetic and logic unit (ALU), and an artificial neural processing unit (NPU). However, the processor 110 of the present disclosure is not limited to the above-described processors.


The processor 110 may be configured to communicate with the artificial neural network memory controller 120. The processor 110 may be configured to generate a data access request. The data access request may be transmitted to the artificial neural network memory controller 120. Here, the data access request may refer to a request to access data required by the processor 110 to process the inference or the learning of the artificial neural network model.


The processor 110 may transmit a data access request to the artificial neural network memory controller 120 to be supplied with data required for the inference or the learning of the artificial neural network model from the artificial neural network memory controller 120 or provide the inference or the learning result of the artificial neural network processed by the processor 110 to the artificial neural network memory controller 120.


The processor 110 may provide the inference result or learning result obtained by processing a specific artificial neural network model. At this time, the processor 110 may be configured to process the operations of the artificial neural network for inference or learning in a specific sequence.


The reason why the processor 110 needs to process the operations of the artificial neural network in a specific sequence is that each artificial neural network model is configured to have a unique artificial neural network structure. That is, each artificial neural network model is configured to have a unique artificial neural network data locality in accordance with the unique artificial neural network structure. Moreover, an operating sequence of the artificial neural network model which is processed by the processor 110 is determined in accordance with the unique artificial neural network data locality.


In other words, the artificial neural network data locality may be configured when the artificial neural network model is compiled by a complier to be executed in a specific processor. The artificial neural network data locality may be configured in accordance with algorithms applied to the complier and the artificial neural network model and an operation characteristic of the processor.


The artificial neural network model to be processed by the processor 110 may be compiled by the processor 110 and a compiler which may consider an algorithm characteristic of the artificial neural network model. That is, when the driving characteristic of the processor 110 is known with the knowledge of the structure and algorithm information of the artificial neural network model, the compiler may be configured to supply the artificial neural network data locality information in the order of the word unit to the artificial neural network memory controller 120.


For example, a weight value of a specific layer of a specific artificial neural network model of an algorithm level of a known art may be calculated in the layer unit. However, the weight value of the specific layer of the specific artificial neural network model of the processor-memory level according to the examples of the present disclosure may be calculated in the word unit scheduled to be processed by the processor 110.


For example, when a size of the cache memory of the processor 110 is smaller than a data size of weights of a specific layer of an artificial neural network model to be processed, the processor 110 may be compiled so as not to process all the weight values of the specific layer at one time.


That is, when the processor 110 calculates the weight values of the specific layer and node values, a cache memory space in which result values are stored may be insufficient due to the weight value which is too large. In this case, a data access request generated by the processor 110 may be increased to a plurality of data access requests. Accordingly, the processor 110 may be configured to process the increased data access requests in a specific order. In this case, the operation sequence of the algorithm level and the operation order in accordance with the artificial neural network data locality of the processor-memory level may be different from each other.


That is, the artificial neural network operation sequence at the algorithm level may be reconstructed by the artificial neural network data locality of the processor-memory level by considering hardware characteristics of the processor and the memory to process the corresponding artificial neural network model.


The artificial neural network data locality of the artificial neural network model existing at the processor-memory level may be defined as information which predicts an operation order of the artificial neural network model to be processed by the processor 110 at the processor-memory level based on a data access request order which is requested to the memory by the processor 110.


In other words, even in the same artificial neural network model, the artificial neural network data locality of the artificial neural network model may be diversely configured in accordance with an operation function of the processor 110, such as a feature map tiling technique or a stationary technique of the processing element, a cache memory capacity such as the number of processing elements of the processor 110, a feature map in the processor 110, and a weight, a memory layered structure in the processor 110, and an algorithm characteristic of a compiler which determines an sequence of the calculating operation of the processor 110 to calculate the artificial neural network model.


For example, the feature map tiling technique is an artificial neural network technique which divides a convolution, and as a convolutional area is divided, the feature map is divided to be calculated. Accordingly, even the same artificial neural network model may have different artificial neural network data localities due to the tiling convolution.


For example, the stationary technique is a technique which controls a driving method of processing elements PE in the neural processing unit. According to the stationary technique, a data type to be processed, for example, one of an input feature map, a weight, and an output feature map, is fixed to the processing element to be reused. Accordingly, a type of data or sequence which is requested to the memory by the processor 110 may vary.


That is, even in the same artificial neural network model, the artificial neural network data locality may be reconstructed in accordance with various algorithms and/or techniques. Accordingly, the artificial neural network data locality may be entirely or partially reconstructed by various conditions, such as a processor, a compiler, or a memory.



FIG. 1B illustrates an example of an exemplary neural processing unit for explaining reconstruction of an artificial neural network data locality pattern which is applicable to various examples of the present disclosure.


Referring to FIG. 1B, exemplary stationary techniques applicable when the processor 110 is a neural processing unit NPU are illustrated.


A plurality of processing elements may be included in the NPU. The processing elements PE may be configured in the form of an array and each processing element may be configured to include a multiplier (x) and an adder (+). The processing elements PE may be connected to a buffer memory or a cache memory, for example, a global buffer. The processing elements PE may fix one data of an input feature map pixel (Ifmap pixel: I), a filter weight W, and a partial sum (Psum: P) to a register of the processing elements PE. The remaining data may be supplied as input data of the processing elements PE. When the accumulation of the partial sums P is completed, it may become an output feature map pixel.


A weight stationary (WS) technique is shown in view (a) of FIG. 1B.


According to the WS technique, filter weights W0 to W7 are fixed to respective register files of the processing elements PE, and input feature map pixels I input to the processing elements PE in parallel move from a zeroth input feature map pixel IO to an eighth input feature map pixel 18 to perform the operation. Partial sums PO to P8 may be accumulated in the processing elements PE which are connected in series. The partial sums PO to P8 may sequentially move to a subsequent processing element. All multiplication and accumulation (MAC) operations which use the fixed filter weights W0 to W7 need to be mapped to the same processing elements PE for serial processing.


According to the above-described configuration, during the convolutional operation of the filter weight W in the register file, the reuse of the filter weight W is maximized to minimize the access energy consumption of the filter weight W.


It should be noted that as the WS technique is applied to the artificial neural network model in a compile step, the artificial neural network data locality of the artificial neural network model is reconstructed to be optimized for the WS technique at the processor-memory level. For example, according to the WS technique, for the purpose of the efficiency of the operation, the filter weights W0 to W7 may be preferentially stored in the processing elements PE. Accordingly, the artificial neural network data locality may be reconstructed in the order of the filter weight W, the input feature map pixel I, and the partial sum P so that the data access request sequence generated by the processor 110 may be determined in accordance with the reconstructed artificial neural network data locality.


An output stationary (OS) technique is shown in view (b) of FIG. 1B. According to the OS technique, the partial sums PO to P7 are fixed to the respective register files of the processing elements PE to be accumulated and the filter weight W which is input to the processing elements PE in parallel moves from the zeroth input filter weight W0 to the seventh filter weight W7 to perform the operation. The input feature map pixels 10 to 17 may move to the processing elements PE connected in series. Each partial sum PO to P7 needs to be fixed to each processing element PE to be mapped to perform the multiplication and accumulation (MAC) operation.


According to the above-described configuration, during the convolutional operation of the filter weight W in the processing elements PE, the partial sum P is fixed to the register file of the processing elements PE to maximize the reuse of the partial sum P and minimize the energy consumption in accordance with the movement of the partial sum P. When the accumulation of the fixed partial sums P is completed, it may become an output feature map.


It should be noted that as the processor 110 applies the output stationary OS technique, the artificial neural network data locality of the artificial neural network model is reconstructed to be optimized for the output stationary OS technique at the processor-memory level. For example, according to the output stationary OS technique, for the purpose of the efficiency of the operation, the partial sums PO to P7 are preferentially stored in the processing elements PE. Accordingly, the artificial neural network data locality may be reconstructed in the order of the partial sum P, the filter weight W, and the input feature map pixel I, so that the data access request sequence generated by the processor 110 may be determined in accordance with the reconstructed artificial neural network data locality. The artificial neural network model compiler receives hardware characteristic information of the processor 110 and the memory to be converted into a code in which the artificial neural network model operates at the processor-memory level. At this time, the artificial neural network model is converted into a code which is executed by the processor so that the artificial neural network model may be converted into a low-level code.


That is, according to the above-described factors, even though the same artificial neural network model is processed, the processor 110 may change an order of data required at every moment in the clock unit. Accordingly, the artificial neural network data locality of the artificial neural network model may be configured to be different at the hardware level.


However, when the configuration of the artificial neural network data locality is completed, the operation order of the processor 110 and a data processing order required for the operation may be accurately repeated at every learning operation or inference operation of the corresponding artificial neural network model.


Hereinafter, the above-described artificial neural network memory system 100 according to the example of the present disclosure may be configured to predict next data to be requested by the processor 110 based on an accurate operation order provided by the artificial neural network data locality to improve a memory latency problem and a memory bandwidth problem, thereby improving the operation processing performance of the artificial neural network and reducing the power consumption.


The artificial neural network memory controller 120 according to the example of the present disclosure is configured to be provided with the artificial neural network data locality information of the artificial neural network model to be processed by the processor 110 or configured to analyze the artificial neural network data locality of the artificial neural network model which is being processed by the processor 110.


The artificial neural network memory controller 120 may be configured to receive the data access request generated by the processor 110.


The artificial neural network memory controller 120 may be configured to monitor or record the data access request received from the processor 110. The artificial neural network memory controller 120 observes the data access requests output by the processor 110 which is processing the artificial neural network model to precisely predict the data access queue which will be requested later. One data access request may be configured to include at least one word unit data.


The artificial neural network memory controller 120 may be configured to sequentially record or monitor the data access request received from the processor 110.


The data access requests which are recorded by the artificial neural network memory controller 120 may be stored in various forms such as a log file, a table, or a list. However, the artificial neural network memory controller 120 according to the example of the present disclosure is not limited to the recorded type or formant of the data access request.


The data access requests which are monitored by the artificial neural network memory controller 120 may be stored in an arbitrary memory in the artificial neural network memory controller 120. However, the artificial neural network memory controller 120 according to the example of the present disclosure is not limited to the monitoring method of the data access request.


The artificial neural network memory controller 120 may be configured to further include an arbitrary memory for recording or monitoring the data access request. However, the artificial neural network memory controller 120 according to the example of the present disclosure is not limited thereto and may be configured to communicate with an external memory.


The artificial neural network memory controller 120 may be configured to monitor or record the data access request received from the processor 110 to analyze the data access requests.


That is, the artificial neural network memory controller 120 may be configured to analyze the received data access requests to analyze the artificial neural network data locality of the artificial neural network model which is being processed by the processor 110.


That is, the artificial neural network memory controller 120 may be configured to analyze the artificial neural network data locality of the artificial neural network model which is compiled to operate at the processor-memory level.


That is, the artificial neural network memory controller 120 may be configured to analyze the operation processing order of the artificial neural network in the unit of memory access requests generated by the processor, based on the artificial neural network data locality of the artificial neural network model at the processor-memory level to analyze the artificial neural network data locality of the artificial neural network model.


According to the above-described configuration, the artificial neural network memory controller 120 may analyze the artificial neural network data locality reconstructed at the processor-memory level.


In some examples, the compiler may be configured to analyze the artificial neural network data locality of the artificial neural network model in the word unit.


In some examples, at least one artificial neural network memory controller may be configured to be provided with the artificial neural network data locality, which is analyzed by the compiler, in the word unit. Here, the word unit may vary to 8 bits, 16 bits, 32 bits, 64 bits, or the like in accordance with the word unit of the processor 110. Here, the word unit may be set to different word units, such as 2 bits, 3 bits, or 5 bits, in accordance with a quantization algorithm of the kernel, the feature map, or the like of the compiled artificial neural network model.


The artificial neural network memory controller 120 may be configured to include a special function register. The special function register may be configured to store the artificial neural network data locality information.


The artificial neural network memory controller 120 may be configured to operate in different modes depending on whether the artificial neural network data locality information is stored.


If the artificial neural network memory controller 120 stores the artificial neural network data locality information, the artificial neural network memory controller 120 may predict the data processing sequence of the artificial neural network model to be processed by the processor 110 in the word unit order in advance so that the artificial neural network memory controller 120 may be configured so as not to record a separate data access request. However, it is not limited thereto, and the artificial neural network memory controller 120 may be configured to verify whether an error exists in the stored artificial neural network data locality while comparing the stored artificial neural network data locality information and the data access request generated by the processor.


If the artificial neural network memory controller 120 is not provided with the artificial neural network data locality information, the artificial neural network memory controller 120 may be configured to observe the data access request generated by the processor 110 to operate in a mode in which the artificial neural network data locality of the artificial neural network model processed by the processor 110 is predicted.


In some examples, the artificial neural network memory system may be configured to include a processor, a memory, and a cache memory and generate, in advance, a predicted data access request including data to be requested by the processor based on the artificial neural network data locality information. The artificial neural network memory system may be configured to store data corresponding to the predicted data access request from the memory in the cache memory before the request of the processor. At this time, the artificial neural network memory system may be configured to operate in any one mode of a first mode configured to operate by receiving the artificial neural network data locality information and a second mode configured to operate by observing data access requests generated by the processor to predict the artificial neural network data locality information. According to the above-described configuration, when the artificial neural network memory system is provided with the artificial neural network data locality information, the data to be requested by the processor is predicted and prepared in advance in the word unit. Further, even though the artificial neural network data locality information is not provided, the data access requests generated by the processor are monitored for a predetermined period to predict the artificial neural network data locality which is being processed by the processor in the data access request unit. Moreover, even though the artificial neural network data locality information is provided, the artificial neural network memory system independently monitors the data access request to reconstruct the artificial neural network data locality to verify the provided artificial neural network data locality. Accordingly, the change or the error of the artificial neural network model may be sensed.


In some examples, at least one artificial neural network memory controller and at least one processor may be configured to directly communicate with each other. According to the above-described configuration, the artificial neural network memory controller may directly receive the data access request from the processor so that a latency caused by a system bus between the processor and the artificial neural network memory controller may be eliminated. In other words, for the direct communication of the processor and the artificial neural network memory controller, a dedicated bus may be further included, or a dedicated communication channel may be further included, but present disclosure is not limited thereto.


In some examples, the artificial neural network data locality information may be configured to be selectively stored in the processor 110 and/or the artificial neural network memory controller 120. The artificial neural network data locality information may be configured to be stored in a special function register included in the processor 110 and/or the artificial neural network memory controller 120. However, it is not limited thereto, and the artificial neural network data locality information may be configured to be stored in an arbitrary memory or a register which is communicable with the artificial neural network memory system.



FIG. 2 illustrates an artificial neural network data locality pattern according to an example of the present disclosure. Hereinafter, an artificial neural network data locality and an artificial neural network data locality pattern of the artificial neural network model will be described with reference to FIG. 2.


The artificial neural network memory controller 120 is configured to record or monitor the data access request received from the processor 110 according to an order.


The artificial neural network memory controller 120 is configured to generate an artificial neural network data locality pattern including a data locality of the artificial neural network model which is being processed by the processor 110. That is, the artificial neural network memory controller 120 may be configured to analyze the data access requests associated with the artificial neural network model generated by the processor 110 to generate a repeated specific pattern. That is, when the data access request is observed, the artificial neural network data locality information may be stored as the artificial neural network data locality pattern.


Referring to FIG. 2, eighteen data access requests are sequentially recorded in the artificial neural network memory controller 120 as an example. Each data access request is configured to include identification information.


The identification information included in the data access request may be configured to include various information.


For example, the identification information may be configured to include at least a memory address value and an operation mode value.


For example, the memory address value may be configured to include memory address values corresponding to the requested data, but the present disclosure is not limited thereto.


For example, the memory address value may be configured to include a start value and an end value of the memory address corresponding to the requested data. According to the above-described configuration, it is considered that data is sequentially stored between the start value and the end value of the memory address. Therefore, a capacity for storing the memory address values may be reduced.


For example, the memory address value may be configured to include a start value of the memory address corresponding to the requested data and a data continuous read trigger value. According to the above-described configuration, data may be continuously read from the start value of the memory address until the continuous read trigger value changes. According to the above-described configuration, data may be continuously read so that the memory effective bandwidth may be increased. That is, when the trigger value is activated, the memory can also operate in burst mode.


For example, the memory address value may be configured to include a start value of the memory address corresponding to the requested data and information about the number of data. The unit of the number of data may be determined based on the unit of the memory capacity. For example, the unit may be one of one byte which is 8 bits, one word which is 4 bytes, and one block which is 1024 bytes, but the present disclosure is not limited thereto. According to the above-described configuration, the data may be continuously read from the start value of the memory address as many as the number of data of the set unit size. According to the above-described configuration, data may be continuously read so that the memory effective bandwidth may be increased.


For example, when the memory is a nonvolatile memory, the memory address value may further include a physical-logical address mapping table or flash translation layer information, but the present disclosure is not limited thereto.


For example, the operation mode may be configured to include a read mode and a write mode. Read and write operations may further include burst mode.


For example, the operation mode may be configured to further include overwrite, but the present disclosure is not limited thereto.


The artificial neural network memory controller 120 may be configured to determine whether the identification information of each of the data access requests is the same.


For example, the artificial neural network memory controller 120 may be configured to determine whether the memory address and the operation mode of each of the data access requests are the same. In other words, the artificial neural network memory controller 120 may be configured to detect a data access request value having the same memory address value and the same operation mode.


For example, when a memory address value and an operation mode of a first data access request are the same as a memory address value and an operation mode of a tenth data access request, the artificial neural network memory controller 120 is configured to generate an artificial neural network data locality pattern corresponding to the corresponding memory address value and operation mode.


The artificial neural network data locality pattern is configured to include data in which addresses of the memory of the data access requests are sequentially recorded.


That is, the artificial neural network memory controller 120 may be configured to detect a repeating cycle of the data access requests having the same memory address value and operation mode to generate an artificial neural network data locality pattern configured by the data access requests with repeated memory address value and operation mode.


That is, the artificial neural network memory controller 120 may be configured to generate the artificial neural network data locality pattern by detecting the repeated pattern of the memory address included in the data access request.


Referring to FIG. 2, when the artificial neural network memory controller 120 identifies that the memory address value and the operation mode of the first data access request are the same as the memory address value and the operation mode of the tenth data access request, the artificial neural network memory controller 120 may be configured to generate one artificial neural network data locality pattern from a starting data access request to a predicted data access request of the repeated data access request, among the same data access requests. In this case, the artificial neural network memory controller 120 may be configured to generate the artificial neural network data locality pattern including a first data access request to a ninth data access request.


That is, the artificial neural network data locality pattern described with reference to FIG. 2 may be configured to include the memory address values and the operation mode values in the order of the first data access request, a second data access request, a third data access request, a fourth data access request, a fifth data access request, a sixth data access request, a seventh data access request, an eighth data access request, and a ninth data access request.


The artificial neural network data locality pattern generated by the artificial neural network memory controller 120 may be stored in various forms such as a log file, a table, or a list. The artificial neural network memory controller 120 according to the example of the present disclosure is not limited to a recorded type or format of the artificial neural network data locality pattern.


The artificial neural network data locality pattern generated by the artificial neural network memory controller 120 may be stored in an arbitrary memory of the artificial neural network memory controller 120. The artificial neural network memory controller 120 according to the example of the present disclosure is not limited to a structure or a method of a memory which stores the artificial neural network data locality pattern.


The artificial neural network memory controller 120 may be configured to further include an arbitrary memory for storing the artificial neural network data locality pattern. However, the artificial neural network memory controller 120 according to the example of the present disclosure is not limited thereto and may be configured to communicate with an external memory.


That is, the artificial neural network memory system 100 according to the example of the present disclosure may be configured to include at least one processor 110 configured to generate a data access request corresponding to the artificial neural network operation and an artificial neural network memory controller 120 configured to sequentially record the data access request to generate an artificial neural network data locality pattern.


When the artificial neural network memory controller 120 generates an artificial neural network data locality pattern, the artificial neural network memory controller 120 may be configured to determine whether the memory address value and the operation mode value of the data access request received from the processor 110 match any one of the memory address values and the operation mode value included in the previously generated artificial neural network data locality pattern.


Referring to FIG. 2, when the artificial neural network memory controller 120 receives the tenth data access request from the processor 110, the artificial neural network memory controller 120 may be configured to determine whether the received data access request has the same memory address value as the memory address value included in the artificial neural network data locality pattern.


Referring to FIG. 2, when the artificial neural network memory controller 120 receives the tenth data access request, the artificial neural network memory controller 120 may be configured to detect that a start value [0] and an end value [0x1000000], which are the memory address values of the tenth data access request, are the same start and end memory address values of the first data access request, and may be configured to detect that a read mode value of an operation mode of the tenth data access request is the same as a read mode value of an operation mode of the first data access request. Thus, the artificial neural network memory controller 120 determines that the tenth data access request is the same as the first data access request and that the tenth data access request is an artificial neural network operation.


When the artificial neural network memory controller 120 receives an eleventh data access request, the artificial neural network memory controller 120 may be configured to detect that a start value [0x1100000] and an end value [0x1110000], which are the memory address values of the eleventh data access request, are the same start and end memory address values of the second data access request, and may be configured to detect that a write mode value of an operation mode of the eleventh data access request is the same as a write mode value of an operation mode of the second data access request. Thus, the artificial neural network memory controller 120 determine that the eleventh data access request is the same as the second data access request and that the eleventh data access request is an artificial neural network operation.


That is, the artificial neural network memory control unit 120 may distinguish the start and the end of the artificial neural network data locality pattern. In addition, the artificial neural network memory controller 120 may prepare in advance for the start of the artificial neural network data locality pattern even if there is no special command after the end of the artificial neural network data locality pattern. Therefore, when the same operations are repeated, there is an effect that data can be prepared before the start of the next inference by predicting the start of the next inference based on the end of the current inference. Therefore, when the same artificial neural network data locality pattern is repeated, it is possible to prevent or reduce the delay time at the beginning and the end.


Referring to FIG. 2 again, the artificial neural network memory controller 120 does not generate the artificial neural network data locality pattern from the first data access request to the ninth data access request. In this case, the artificial neural network memory controller 120 is initialized or the processor 110 does not perform the artificial neural network operation. Accordingly, the artificial neural network memory controller 120 does not detect the matching of the pattern to the ninth data access request. The artificial neural network memory controller 120 may determine the identity to the first data access request at the time of the tenth data access request, generate the artificial neural network data locality pattern, and record whether the patterns match. The tenth to eighteenth data access requests are the same as the first to ninth data access requests, so that the artificial neural network memory controller 120 may determine that the patterns of the tenth data access request through the eighteenth data access request match the artificial neural network data locality pattern.


That is, the artificial neural network memory controller 120 may be configured to determine whether an operation which is being processed by the processor 110 is an artificial neural network operation by utilizing the artificial neural network data locality pattern. According to the above-described configuration, even though the artificial neural network memory controller 120 receives only the data access request including the memory address value and the operation mode value generated by the processor 110, the artificial neural network memory controller 120 may determine that the processor 110 is processing the artificial neural network operation. Accordingly, the artificial neural network memory controller 120 may determine whether the processor 110 is currently performing the artificial neural network operation based on the artificial neural network data locality pattern, without having separate additional identification information.


As it will be additionally described with reference to FIG. 2, each data access request may be configured to be stored as a token. For example, the data access request of each artificial neural network may be tokenized to be stored. For example, the data access request of each artificial neural network may be tokenized based on the identification information. For example, the data access request of each artificial neural network may be tokenized based on the memory address value. However, the examples of the present disclosure are not limited thereto, and the token may be referred to as a code, an identifier, or the like.


For example, the first data access request may be stored as a token [1]. The fourth data access request may be stored as a token [4]. The seventh data access request may be stored as a token [7]. For example, the artificial neural network data locality pattern may be stored as tokens [1-2-3-4-5-6-7-8-9]. For example, the tenth data access request has the same memory address value and the same operation mode value as the token [1] so that the tenth data access request may be stored as the token [1]. The thirteenth data access request has the same memory address value and the same operation mode value as the token [4] so that the thirteenth data access request may be stored as the token [4]. Accordingly, when the artificial neural network memory controller 120 detects the same token as the token of the artificial neural network data locality pattern, the artificial neural network memory controller may be configured to determine that the corresponding data access request is an artificial neural network operation.


According to the above-described configuration, the artificial neural network memory controller 120 may easily and quickly recognize and distinguish the data access request by utilizing the tokenized artificial neural network data locality pattern. Moreover, even when additional identification information and/or data is further added to the data access request, the artificial neural network memory controller uses the same token to utilize the token even when the additional information of the data access request is increased to easily and quickly recognize and distinguish the data access request.


In some examples, the artificial neural network data locality pattern stored in the artificial neural network memory controller may be eliminated or initialized. For example, when the artificial neural network data locality pattern is not utilized before a predetermined time is expired, for example, when the data access request matching the artificial neural network data locality pattern is not generated for a specific time, the artificial neural network memory controller determines that the utilizing frequency of the artificial neural network data locality pattern is low to eliminate or initialize the artificial neural network data locality pattern.


According to the above-described configuration, the availability of the storage space of the memory which stores the artificial neural network data locality pattern may be improved.


In some examples, the artificial neural network memory controller may be configured to store an updated pattern and a previous pattern of the artificial neural network data locality pattern to determine whether the artificial neural network model is changed. That is, when there is a plurality of artificial neural network models, the artificial neural network memory controller may be configured to further generate artificial neural network data locality patterns corresponding to the number of artificial neural network models.


For example, when a first artificial neural network data locality pattern is a token [1-2-3-4-5-6-7-8-9] and a second artificial neural network data locality pattern is a token [11-12-13-14-15-16-17-18], if the processor generates a data access request corresponding to the token [1], the artificial neural network memory controller may be configured to select the first artificial neural network data locality pattern. Alternatively, if the processor generates a data access request corresponding to the token [11], the artificial neural network memory controller may be configured to select the second artificial neural network data locality pattern.


According to the above-described configuration, the artificial neural network memory controller may store a plurality of artificial neural network data locality pattern and, when the artificial neural network model processed by the processor is changed to another artificial neural network model, may quickly apply a previously stored artificial neural network data locality pattern.


In some examples, the artificial neural network memory controller may be configured to determine whether the data access requests are requests of one artificial neural network model or are mixtures of the requests of the plurality of artificial neural network models. Further, the artificial neural network memory controller may be configured to predict the data access request corresponding to the artificial neural network data locality of each of the plurality of artificial neural network models.


For example, the processor may simultaneously process the plurality of artificial neural network models and, in this case, the data access request generated by the processor may be mixed data access requests corresponding to the plurality of artificial neural network models.


For example, when a first artificial neural network data locality pattern is a token [1-2-3-4-5-6-7-8-9] and a second artificial neural network data locality pattern is a token [11-12-13-14-15-16-17-18], the processor 110 may generate tokens corresponding to data access requests in the order of [1-11-2-3-12-13-14-4-5-6-15-16-7-8-9].


The artificial neural network memory controller knows each artificial neural network data locality pattern, so that even though the token [1] is generated and then the token [11] is generated, the artificial neural network memory controller may predict that the token [2] will be generated next. Therefore, the artificial neural network memory controller may generate, in advance, a predicted data access request corresponding to the token [2]. Further, even though the token [2] is generated after the token [11] is generated, the artificial neural network memory controller may predict that the token [12] will be generated next. Therefore, the artificial neural network memory controller may generate, in advance, a predicted data access request corresponding to the token [12].


According to the above-described configuration, the artificial neural network memory controller 120 predicts the data access requests to be generated by the processor 110 which processes the plurality of artificial neural network models, for every artificial neural network model, to predict and prepare the data to be requested by the processor 110.


In some examples, the artificial neural network memory controller may be configured to store a plurality of artificial neural network data locality patterns.


For example, when the processor processes two artificial neural network models, the artificial neural network memory controller may be configured to store the artificial neural network data locality pattern of each artificial neural network model.


According to the above-described configuration, when the operation of each artificial neural network model is processed, a subsequent data access request corresponding to each model may be predicted so that according to the example of the present disclosure, the processing speed of the artificial neural network operation may be improved.


In some examples, the artificial neural network memory controller may be configured to further include an artificial neural network model which is configured to machine-learn the artificial neural network data locality pattern.


According to the above-described configuration, the artificial neural network model of the artificial neural network memory controller may be configured to perform reinforcement learning on the data access request generated by the processor in real time. Further, the artificial neural network model of the artificial neural network memory controller may be a model trained by utilizing the artificial neural network data locality patterns of a known artificial neural network model as learning data. Accordingly, the artificial neural network memory controller may extract the artificial neural network data locality pattern from various artificial neural network models. Specifically, when various artificial neural network models are processed by requests of a plurality of users, like a server, this method may be effective.


As it will be additionally described with reference to FIG. 2, the artificial neural network memory controller 120 may be configured to monitor the artificial neural network model processed by the processor 110 dynamically and in real time and determine whether the artificial neural network model is changed.


For example, the artificial neural network memory controller 120 may be configured to statistically utilize a pattern matching frequency of the artificial neural network data locality pattern to determine the reliability of the artificial neural network data locality pattern. It may be configured such that, as the pattern matching frequency of the artificial neural network data locality pattern is increased, the reliability of the artificial neural network data locality pattern is increased and such that, as the pattern matching frequency of the artificial neural network data locality pattern is reduced, the reliability of the artificial neural network data locality pattern is reduced.


According to the above-described configuration, when the processor 110 repeatedly processes the specific artificial neural network model, the artificial neural network memory controller 120 may improve the prediction reliability of the artificial neural network data locality of the specific artificial neural network model.



FIG. 3 illustrates an exemplary artificial neural network model for explaining an artificial neural network data locality pattern which is applicable to various examples of the present disclosure.


An exemplary artificial neural network model 1300 which is being processed by the processor 110 as illustrated in FIG. 3 may be an arbitrary artificial neural network model which is trained to perform a specific inference function. For the convenience of description, an artificial neural network model in which all nodes are fully connected has been illustrated, but the present disclosure is not limited thereto.


Even though not illustrated in FIG. 3, an artificial neural network model applicable to the present disclosure may be a convolutional neural network (CNN) which is one of deep neural networks (DNN). An exemplary artificial neural network model may be a model such as a fully convolutional network (FCN) having VGG, VGG16, DenseNET, and an encoder-decoder structure, a deep neural network (DNN) such as SegNet, DeconvNet, DeepLAB V3+, or U-net, or SqueezeNet, Alexnet, ResNet18, MobileNet-v2, GoogLeNet, Resnet-v2, Resnet50, Resnet101, and Inception-v3, or an ensemble model based on at least two different models, but the artificial neural network model of the present disclosure is not limited thereto.


The above-described exemplary artificial neural network models may be configured to have an artificial neural network data locality.


Referring to FIG. 3 again, the artificial neural network data locality of the artificial neural network model processed by the processor 110 will be described in detail.


The exemplary artificial neural network model 1300 includes an input layer 1310, a first connection network 1320, a first hidden layer 1330, a second connection network 1340, a second hidden layer 1350, a third connection network 1360, and an output layer 1370.


The connection networks of the artificial neural network have corresponding weight values. A weight value of the connection network is multiplied with the input node value and an accumulated value of multiplied values is stored in the node of the corresponding output layer.


In other words, the connection network of the artificial neural network model 1300 is represented by lines, and weight is represented by a symbol ⊗.


In other words, various activation functions to impart non-linearity to the accumulated value may be additionally provided. The activation function may be, for example, a sigmoid function, a hyperbolic tangent function, an ELU function, a Hard-Sigmoid function, a Swish function, a Hard-Swish function, a SELU function, a CELU function, a GELU function, a TANHSHRINK function, a SOFTPLUS function, a MISH function, a Piecewise Interpolation Approximation for Non-linear function, or an ReLU function, but the present disclosure is not limited thereto.


The input layer 1310 of the exemplary artificial neural network model 1300 includes input nodes x1 and x2.


The first connection network 1320 of the exemplary artificial neural network model 1300 includes connection networks having six weight values which connect nodes of the input layer 1310 and nodes of the first hidden layer 1330.


The first hidden layer 1330 of the exemplary artificial neural network model 1300 includes nodes a1, a2, and a3. Weight values of the first connection network 1320 are multiplied with a node value of the corresponding input layer 1310 and an accumulated value of the multiplied values is stored in the first hidden layer 1330.


The second connection network 1340 of the exemplary artificial neural network model 1300 includes connection networks having nine weight values which connect nodes of the first hidden layer 1330 and nodes of the second hidden layer 1350.


The second hidden layer 1350 of the exemplary artificial neural network model 1300 includes nodes b1, b2, and b3. The weight value of the second connection network 1340 is multiplied with the node value of the corresponding first hidden layer 1330 and the accumulated value of the multiplied values is stored in the second hidden layer 1350.


The third connection network 1360 of the exemplary artificial neural network model 1300 includes connection networks having six weight values which connect nodes of the second hidden layer 1350 and nodes of the output layer 1370.


The output layer 1370 of the exemplary artificial neural network model 1300 includes nodes y1 and y2. The weight value of the third connection network 1360 is multiplied with the input node value of the corresponding second hidden layer 1350 and the accumulated value of the multiplied values is stored in the output layer 1370.


According to the structure of the above-described artificial neural network model 1300, it is recognized that the operation for each layer needs to be sequentially performed. That is, there may be a problem in that when the structure of the artificial neural network model is confirmed, the operation order for every layer needs to be determined and when the operation is performed in a different order, the inference result may be inaccurate. The order of the operation or an order of the data flow in accordance with the structure of the artificial neural network model may be defined as an artificial neural network data locality.


In addition, for the convenience of description, in FIG. 2, even though the layer unit is described, the examples of the present disclosure are not limited to the layer unit. The processor 110 according to the examples of the present disclosure processes the data based on the artificial neural network data locality so that the processor may operate in the word unit or the data access request unit, rather than the layer unit. Here, the data size of the data access request may be smaller than or equal to the data size of the corresponding layer.


Referring to FIG. 3 again, for example, for the multiplication operation of the weight values of the first connection network 1320 and the node value of the input layer 1310, the processor 110 may generate the data access request in the layer unit.


However, the layer operation of the weight values of the first connection network 1320 and the node values of the input layer 1310 is not processed as one data access request, but may be processed as a plurality of divided sequential data access requests in accordance with the feature map division convolution of the processor 110, the stationary technique of the processing element, the number of processing elements of the processor, the cache memory capacity of the processor 110, a memory layered structure of the processor 110, and/or the compiler algorithm of the processor 110.


When a data access request to be requested by the processor 110 is divided into a plurality of data access requests, the order of requesting the divided data access requests may be determined by the artificial neural network data locality. At this time, the artificial neural network memory controller 120 may be configured to be provided with the artificial neural network data locality to be prepared, to provide data corresponding to a subsequent data access request to be requested by the processor 110. Alternatively, the artificial neural network memory controller 120 may be configured to predict the artificial neural network data locality to be prepared, to provide data corresponding to a subsequent data access request to be requested by the processor 110.


Data access requests, which are generated by the processor 110 during the artificial neural network operation of the artificial neural network model 1300 of FIG. 3, and an artificial neural network data locality will be described.


The processor 110 generates a first data access request to read input node values of the input layer 1310 of the artificial neural network model 1300. The first data access request includes a first memory address value and a read mode value. The first data access request may be stored as the token [1].


Next, the processor 110 generates a second data access request to read weight values of the first connection network 1320 of the artificial neural network model 1300. The second data access request includes a second memory address value and a read mode value. The second data access request may be stored as the token [2].


Next, the processor 110 generates a third data access request for storing the node values of the first hidden layer 1330 obtained by multiplying and accumulating the weight values of the first connection network 1320 of the artificial neural network model 1300 and the node values of the input layer 1310. The third data access request includes a third memory address value and a write mode value. The third data access request may be stored as the token [3].


Next, the processor 110 generates a fourth data access request to read node values stored in the first hidden layer 1330 of the artificial neural network model 1300. The fourth data access request includes a third memory address value and a read mode value. The fourth data access request may be stored as the token [4].


Next, the processor 110 generates a fifth data access request to read weight values of the second connection network 1340 of the artificial neural network model 1300. The fifth data access request includes a fifth memory address value and a write mode value. The fifth data access request may be stored as the token [5].


Next, the processor 110 generates a sixth data access request for storing the node values of the second hidden layer 1350 obtained by multiplying and accumulating the weight values of the second connection network 1340 of the artificial neural network model 1300 and the node values of the first hidden layer 1330. The sixth data access request includes a sixth memory address value and a write mode value. The sixth data access request may be stored as the token [6].


Next, the processor 110 generates a seventh data access request to read node values stored in the second hidden layer 1350 of the artificial neural network model 1300. The seventh data access request includes a sixth memory address value and a read mode value. The seventh data access request may be stored as the token [7].


Next, the processor 110 generates an eighth data access request to read weight values of the third connection network 1360 of the artificial neural network model 1300. The eighth data access request includes an eighth memory address value and a read mode value. The eighth data access request may be stored as the token [8].


Next, the processor 110 generates a ninth data access request for storing the node values of the output layer 1370 obtained by multiplying and accumulating the weight values of the third connection network 1360 of the artificial neural network model 1300 and the node values of the second hidden layer 1350. The ninth data access request includes a ninth memory address value and a write mode value. The ninth data access request may be stored as the token [9]. The node values may be a feature map, an activation map, or the like, but are not limited thereto. The weight values may be a kernel window, but are not limited thereto.


That is, the processor 110 needs to generate first to ninth data access requests for the inference of the exemplary artificial neural network model 1300. If the sequence of the data access request generated by the processor 110 is mixed, the artificial neural network data locality of the artificial neural network model 1300 is damaged so that an error may occur in the inference result of the artificial neural network model 1300 or the accuracy may be impaired. For example, the processor 110 may calculate the second layer first and then calculate the first layer. Accordingly, the processor 110 may be configured to sequentially generate the data access request based on the artificial neural network data locality. Therefore, it is assumed that the artificial neural network memory controller 120 may sequentially generate the data access request based on the artificial neural network data locality when the processor 110 operates the artificial neural network.


However, as described above, each data access request may be reinterpreted at the processor-memory level according to the hardware characteristic of the processor. In the above-described example, it has been described that the available capacity of the cache memory of the processor is sufficient and that the data size of the node value and the data size of the weight value are smaller than the available capacity of the cache memory. Accordingly, it is described that each layer is processed in one data access request unit. If the data size such as the weight value, the feature map, the kernel, the activation map, and the like of the artificial neural network model is larger than the available capacity of the cache memory of the processor, the corresponding data access request may be divided into a plurality of data access requests and in this case, the artificial neural network data locality of the artificial neural network model may be reconstructed.


The artificial neural network memory controller 120 according to the example of the present disclosure may generate the artificial neural network data locality pattern so that the artificial neural network memory controller may operate to correspond to the artificial neural network data locality of the artificial neural network model to be actively processed by the processor.


That is, even though the actual artificial neural network data locality of the artificial neural network model which is being processed by the processor 110 is not known, the artificial neural network memory controller 120 may actually analyze the artificial neural network data locality by analyzing the recorded data access request.


That is, even though structure information of the artificial neural network model which is being processed by the processor 110 is not provided, the artificial neural network memory controller 120 may actually analyze the artificial neural network data locality by analyzing the recorded data access request.


In some examples, the artificial neural network memory controller may be configured to be provided with an artificial neural network data locality pattern which is generated in advance at the processor-memory level.



FIG. 4 illustrates an artificial neural network data locality pattern 1400 obtained by analyzing the artificial neural network model of FIG. 3 by an artificial neural network memory controller according to an example of the present disclosure. FIG. 5 illustrates a token and identification information 1500 corresponding to the artificial neural network data locality pattern of FIG. 4. That is, FIG. 5 illustrates identification information 1500 corresponding to the token corresponding to the artificial neural network data locality pattern 1400 of FIG. 4.


The artificial neural network data locality pattern 1400 of FIG. 4 is illustrated as tokens for the convenience of description. Referring to FIGS. 1A to 4, the artificial neural network data locality pattern 1400 of the artificial neural network model 1300 is stored as tokens [1-2-3-4-5-6-7-8-9].


Each data access request is configured to include identification information. Each data access request may be represented by a token, but this representation is merely for the convenience of description. That is, the present disclosure is not limited to the token.


According to the artificial neural network data locality pattern 1400, the artificial neural network memory controller 120 may sequentially predict an order of tokens which will be generated after the present token.


For example, the artificial neural network data locality pattern 1400 may be configured to have a loop type pattern in which the orders are connected from the final token to the start token, but the present disclosure is not limited thereto.


For example, the artificial neural network data locality pattern 1400 may be configured by memory addresses having a repeated loop characteristic, but the present disclosure is not limited thereto.


For example, the artificial neural network data locality pattern 1400 may be configured to further include identification information for identifying the start and the end of the operation of the artificial neural network model, but the present disclosure is not limited thereto.


For example, the start and the end of the artificial neural network data locality pattern 1400 may be configured to be distinguished as a start token and a final token of the pattern, but the present disclosure is not limited thereto.


According to the above-described configuration, when the processor 110 repeatedly infers the specific artificial neural network model, since the artificial neural network data locality pattern 1400 is a loop type pattern, even though the present inference of the specific artificial neural network model ends, the start of the next inference may be predicted.


For example, in the case of the artificial neural network model which recognizes an object of an image of a front camera mounted in an autonomous vehicle at a speed of 30 IPS (inferences per second), the same inference is continuously repeated at a specific cycle. Accordingly, when the above-described loop type artificial neural network data locality pattern is utilized, it is possible to predict the repeated data access request.


When the identification information is additionally described as an example, the token [3] and the token [4] of the artificial neural network data locality pattern 1400 have the same memory address value but have different operation modes.


Accordingly, even though the memory address values are the same, the operations modes are different, so that the artificial neural network memory controller 120 may be configured to classify the third data access request and the fourth data access request as different tokens. However, the identification information of the examples of the present disclosure is not limited to the operation mode, but may be configured to predict the artificial neural network data locality pattern only with the memory address value.


The artificial neural network memory controller 120 may be configured to generate a corresponding predicted data access request based on the artificial neural network data locality pattern 1400.


The artificial neural network memory controller 120 may be configured to sequentially further generate, in advance, a predicted data access request based on the artificial neural network data locality pattern 1400.


According to the above-described configuration, when the processor 110 generates a specific data access request included in the artificial neural network data locality pattern 1400, the artificial neural network memory controller 120 may sequentially predict at least one data access request after the specific data access request. For example, when the processor 110 generates the token [1], the artificial neural network memory controller 120 may predict that a data access request corresponding to the token [2] is subsequently generated. For example, when the processor 110 generates the token [3], the artificial neural network memory controller 120 may predict that a data access request corresponding to the token [4] is subsequently generated. For example, when the processor 110 generates the token [1], the artificial neural network memory controller 120 may predict that corresponding data access requests are generated in the order of tokens [2-3-4-5-6-7-8-9].


In other words, when the processor 110 processes a plurality of artificial neural network models, a data locality pattern which has not been predicted may intervene between the tokens of the artificial neural network data locality pattern 1400. For example, after the token [2], a new token [4] may be interrupted. However, even in this case, the artificial neural network memory controller 120 may predict and prepare that the processor 110 generates the token [3] after the token [2]. For example, when the processor 110 generates the token [9], the artificial neural network memory controller 120 may predict that the processor 110 generates the token [1].



FIG. 6 illustrates the generation 1600 of a predicted data access request and a subsequent (i.e., next) actual data access request, based on an artificial neural network data locality pattern, by an artificial neural network memory controller according to an example of the present disclosure.


The artificial neural network memory controller 120 according to the example of the present disclosure may be configured to utilize the artificial neural network data locality pattern to predict a subsequent data access request to be subsequently requested by the processor 110 to generate, in advance, a predicted data access request.


Referring to FIG. 6, the data access request token refers to a token corresponding to a data access request which is received from the processor 110 by the artificial neural network memory controller 120. The predicted data access request token is a token corresponding to a data access request obtained by predicting a data access request to be subsequently requested by the processor 110, based on the artificial neural network data locality pattern by the artificial neural network memory controller 120. The subsequent data access request token is a data access request token which is actually generated by the processor 110 immediately after generating the predicted data access request token. The token of the present disclosure is just an example for the convenience of description; that is, the present disclosure is not limited to the token.


The data access request that will be generated by a processor and the predicted data access request that is predicted by the artificial neural network memory controller before generation by the processor may correspond to a particular data access request token. In this case, the data access request and the predicted data access request matching a specific data access request token may be configured to have the same memory address. That is, the data access request and the predicted data access request may be configured to include the same memory address.


For example, when the data access request token is [3] and the predicted data access request token is [3], the memory address value of each token may be the same. That is, the data access request and the predicted data access request may be configured to include the same operation mode value. For example, when the data access request token is [3] and the predicted data access request token is [3], the operation mode value of each token may be the same.


Referring to FIG. 6, when the processor 110 generates the data access request corresponding to the token [1], the artificial neural network memory controller 120 generates the predicted data access request corresponding to the token [2]. The processor 110 generates a subsequent (actual) data access request corresponding to the token [2] after generating the predicted data access request. The artificial neural network memory controller 120 is configured to determine whether the predicted data access request precisely predicts the subsequent data access request. The same token corresponds to the predicted data access request and the subsequent data access request so that the artificial neural network memory controller 120 may determine that the patterns match.


Next, for example, when the processor 110 generates the data access request corresponding to the token [2], the artificial neural network memory controller 120 generates the predicted data access request corresponding to the token [3]. The processor 110 generates a subsequent (actual) data access request corresponding to the token [3] after generating the predicted data access request. The artificial neural network memory controller 120 is configured to determine whether the predicted data access request precisely predicts the subsequent (actual) data access request. The same token corresponds to the predicted data access request and the subsequent (actual) data access request so that the artificial neural network memory controller 120 may determine that the patterns match.


For example, when the processor 110 generates the data access request corresponding to the token [9], the artificial neural network memory controller 120 generates the predicted data access request corresponding to the token [1]. The processor 110 generates a subsequent (actual) data access request corresponding to the token [9] after generating the predicted data access request. The artificial neural network memory controller 120 is configured to determine whether the predicted data access request precisely predicts the subsequent (actual) data access request. The same token corresponds to the predicted data access request and the subsequent (actual) data access request so that the artificial neural network memory controller 120 may determine that the patterns match.


When the processor 110 generates the subsequent (actual) data access request after the artificial neural network memory controller 120 generates the predicted data access request, the artificial neural network memory controller 120 may be configured to determine whether the predicted data access request and the subsequent (actual) data access request are the same requests.


According to the above-described configuration, the artificial neural network memory system 100 may detect the change of the artificial neural network data locality of the artificial neural network model which is processed by the processor 110. Accordingly, even though the artificial neural network model is changed, the artificial neural network memory controller 120 may analyze the changed artificial neural network data locality.


When the artificial neural network memory controller 120 determines that the predicted data access request and the subsequent (actual) data access request are the same requests, the artificial neural network memory controller 120 may be configured to maintain the artificial neural network data locality pattern.


According to the above-described configuration, the artificial neural network memory system 100 detects that the artificial neural network model processed by the processor 110 is repeatedly used, to more quickly prepare or provide data requested by the processor 110.


When the artificial neural network memory controller 120 determines that the predicted data access request and the subsequent (actual) data access request are different, the artificial neural network memory controller 120 may be configured to update the artificial neural network data locality pattern or to further generate a new artificial neural network data locality pattern.


According to the above-described configuration, the artificial neural network memory system 100 may detect the change of the artificial neural network model which is processed by the processor 110 to generate a predicted data access request corresponding to the changed artificial neural network model.


In some examples, the artificial neural network memory controller may be configured to generate continuous predicted data access requests.


For example, when the data access request token is [2], a predicted data access request which is generated by the artificial neural network memory controller may be a data access request corresponding to the token [3]. However, it is not limited thereto and, for example, the predicted data access request generated by the artificial neural network memory controller may be a plurality of data access requests corresponding to tokens [3-4]. However, it is not limited thereto and, for example, the predicted data access request generated by the artificial neural network memory controller may be a plurality of data access requests corresponding to tokens [3-4-5-6].


According to the above-described configuration, the artificial neural network memory controller may generate a predicted data access request which predicts the entire order of the continuously repeated data access requests, based on the artificial neural network data locality pattern.


According to the above-described configuration, the artificial neural network memory controller may generate a predicted data access request which predicts the order of at least some data access requests, based on the artificial neural network data locality pattern.



FIG. 7 illustrates an operation of an artificial neural network memory controller according to an example of the present disclosure.


Referring to FIG. 7, for the artificial neural network operation processing, the processor 110 may be configured to generate a data access request corresponding to the artificial neural network model based on the artificial neural network data locality.


The artificial neural network memory controller 120 sequentially records the data access requests generated in the processor 110 to generate the artificial neural network data locality pattern.


The artificial neural network memory controller 120 compares the generated artificial neural network data locality pattern and the data access request generated by the processor 110 to generate, in advance, a predicted data access request which corresponds to a subsequent data access request to be generated by the processor 110.


The artificial neural network memory system 100 according to the example of the present disclosure may be configured to include at least one processor 110 configured to generate a data access request corresponding to the artificial neural network operation (S710) and may be further configured to generate an artificial neural network data locality pattern of an artificial neural network operation by sequentially recording the data access request (S720). The artificial neural network memory system 100 may be configured to include at least one artificial neural network memory controller 120 configured to generate a predicted data access request which predicts a subsequent data access request of the data access request generated by at least one processor 110, based on the artificial neural network data locality pattern.


That is, at least one artificial neural network memory controller 120 generates a predicted data access request before generating a subsequent data access request (S730).


That is, at least one processor 110 is configured to transmit the data access request to at least one artificial neural network memory controller 120 and at least one artificial neural network memory controller 120 may be configured to output the predicted data access request corresponding to the data access request.


The artificial neural network memory system 100 according to one example of the present disclosure may be configured to include at least one processor 110 configured to generate a data access request corresponding to the artificial neural network operation and at least one artificial neural network memory controller 120 configured to generate an artificial neural network data locality pattern of an artificial neural network operation by sequentially recording the data access request generated by at least one processor 110 and to generate a predicted data access request which predicts a subsequent (actual) data access request of the data access request generated by at least one processor 110 based on the artificial neural network data locality pattern.


According to the above-described configuration, the artificial neural network memory controller 120 predicts a subsequent (actual) data access request to be generated by the artificial neural network model, which is being processed by the processor 110 based on the artificial neural network data locality pattern, so that it is advantageous in that the corresponding data may be prepared in advance to be provided before the request of the processor 110.


The artificial neural network memory controller 120 may be configured to compare the generated predicted data access request and a subsequent data access request which is generated by the processor 110 after generating the predicted data access request to determine whether the artificial neural network data locality pattern matches (S740).


According to the above-described configuration, the artificial neural network memory controller 120 generates the predicted data access request before generating the subsequent data access request to be prepared to provide the data in advance. Accordingly, the artificial neural network memory controller 120 may substantially eliminate or reduce a latency which may be generated when the data is provided to the processor 110.



FIG. 8 illustrates an artificial neural network memory system 200 according to another example of the present disclosure.


Referring to FIG. 8, the artificial neural network memory system 200 may be configured to include a processor 210, an artificial neural network memory controller 220, and a memory 230.


The artificial neural network memory system 200 of FIG. 8 and the artificial neural network memory system 100 of FIG. 1A are substantially the same except that the artificial neural network memory system 200 further includes the memory 230. Therefore, for the convenience of description, the redundant description will be omitted.


The artificial neural network memory system 200 includes the memory 230 configured to communicate with the artificial neural network memory controller 220 and the memory 230 may be configured to operate in accordance with the memory access request output from the artificial neural network memory controller 220.


The processor 210 may be configured to communicate with the artificial neural network memory controller 220. The processor 210 may be configured to generate a data access request to be transmitted to the artificial neural network memory controller 220. The data access request may be generated based on the artificial neural network data locality of the artificial neural network model which is being processed. The processor 210 is configured to be provided with the data corresponding to the data access request from the artificial neural network memory controller 220.


The artificial neural network memory controller 220 may be configured to receive the data access request generated by the processor 210. The artificial neural network memory controller 220 may be configured to generate an artificial neural network data locality pattern by analyzing the artificial neural network data locality of the artificial neural network model which is being processed by the processor 210.


The artificial neural network memory controller 220 may be configured to control the memory 230 by generating the memory access request. The artificial neural network memory controller 220 may be configured to generate the memory access request corresponding to the data access request. That is, the artificial neural network memory controller 220 may be configured to generate the memory access request corresponding to the data access request generated by the processor 210. For example, when the artificial neural network memory controller 220 does not generate the artificial neural network data locality pattern, the artificial neural network memory controller 220 may be configured to generate the memory access request based on the data access request generated by the processor 210. In this case, the memory access request may be configured to include the memory address value and the operation mode value among identification information included in the data access request.


The artificial neural network memory controller 220 may be configured to generate the memory access request corresponding to a predicted data access request. That is, the artificial neural network memory controller 220 may be configured to generate the memory access request based on the predicted data access request which is generated based on the artificial neural network data locality pattern. For example, when the artificial neural network memory controller 220 generates the artificial neural network data locality pattern, the artificial neural network memory controller 220 may be configured to generate the memory access request based on the predicted data access request.


According to the above-described configuration, the artificial neural network memory controller 220 may transmit and receive data to and from the memory 230 by means of the memory access request and, when the memory access request is generated based on the predicted data access request, the artificial neural network memory system 200 may more quickly provide the data to the processor 210.


The artificial neural network memory controller 220 may be configured to generate the memory access request based on one of the data access request generated by the processor 210 and the predicted data access request generated by the artificial neural network memory controller 220. That is, the memory access request generated by the artificial neural network memory controller 220 may be selectively generated based on the data access request or the predicted data access request.


The artificial neural network memory controller 220 may be configured to generate the memory access request including at least a part of identification information included in the data access request and the predicted data access request. For example, the data access request generated by the processor 210 may include a memory address value and an operation mode value. At this time, the memory access request generated by the artificial neural network memory controller 220 may be configured to include a memory address value and an operation mode value of the corresponding data access request.


That is, each of the data access request, the predicted data access request, and the memory access request may be configured to include the corresponding memory address value and operation mode value. The operation mode may be configured to include a read mode and a write mode. For example, the memory access request generated by the artificial neural network memory controller 220 may be configured to have a data type having the same configuration as the data access request or the predicted data access request. Accordingly, from the viewpoint of the memory 230, even though the data access request and the predicted data access request are not distinguished, the memory access request task may be performed in accordance with the instruction of the artificial neural network memory controller 220.


According to the above-described configuration, the memory 230 may operate regardless of whether the memory access request generated by the artificial neural network memory controller 220 is based on the data access request or based on the predicted data access request. Accordingly, even though the artificial neural network memory controller 220 operates based on the artificial neural network data locality, the artificial neural network memory controller may operate to be compatible with various types of memories.


The artificial neural network memory controller 220 transmits the memory access request to the memory 230 and the memory 230 performs a memory operation corresponding to the memory access request.


The memory according to the examples of the present disclosure may be implemented in various forms. The memory may be implemented by a volatile memory and a non-volatile memory.


The volatile memory may include a dynamic RAM (DRAM) and a static RAM (SRAM). The non-volatile memory may include programmable ROM


(PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), a flash memory, a ferroelectric RAM (FRAM), a magnetic RAM (MRAM), and a phase change memory device (phase change RAM), but the present disclosure is not limited thereto.


The memory 230 may be configured to store at least one of inference data, weight data, and feature map data of the artificial neural network model which is being processed by the processor 210. The inference data may be an input signal of the artificial neural network model.


The memory 230 may be configured to receive a memory access request from the artificial neural network memory controller 220. The memory 230 may be configured to perform a memory operation corresponding to the received memory access request. The operation mode which controls the memory operation may include a read mode or a write mode.


For example, when the operation mode of the received memory access request is a write mode, the memory 230 may store the data received from the artificial neural network memory controller 220 in the corresponding memory address value.


For example, when the operation mode of the received memory access request is a read mode, the memory 230 may transmit the data stored in the corresponding memory address value to the artificial neural network memory controller 220. The artificial neural network memory controller 220 may be configured to transmit the received data to the processor 210 again.


The memory 230 may have a latency. The latency of the memory 230 may refer to a time delay that occurs when the artificial neural network memory controller 220 processes the memory access request. That is, when the memory 230 receives the memory access request from the artificial neural network memory controller 220, actually requested data is output from the memory 230 after a latency of a specific clock cycle.


In order to process the memory access request, the memory 230 may access the memory address value included in the memory access request. Accordingly, a time to access the memory address value is necessary and the time may be defined as a memory latency. For example, a CAS latency of the DDR4 SDRM memory is approximately 10 ns. When the data is not provided to the processor 210 during the latency, the processor 210 is in an idle state so that the processor is not performing an actual operation.


In addition, in the case of the DRAM which is one type of memory 230, a number of clock cycles are consumed to activate a word line and a bit line in accordance with a row address of the memory 230, a number of clock cycles are consumed to activate a column line, and a number of clock cycles are consumed to allow the data to pass through a path through which the data is transmitted to the outside of the memory 230. Further, in the case of the NAND flash memory, units which are activated at one time are large, so that a number of clock cycles may be additionally consumed used to search for data of a required address among them.


The memory 230 may have a bandwidth. A data transfer rate of the memory 230 may be defined as a memory bandwidth. For example, a bandwidth of the DDR4 SDRAM memory is approximately 4 GByte/sec. As the memory bandwidth is higher, the memory 230 may more quickly transmit data to the processor 210.


That is, the processing rate of the artificial neural network memory system 200 is affected by the latency generated when data to be processed by the processor 210 is provided and the bandwidth performance of the memory 230, more than the processing performance of the processor 210.


In other words, the bandwidth of the memory is gradually increased, but the latency of the memory is relatively slowly improved as compared with the improvement speed of the bandwidth. Specifically, whenever the memory access request is generated, the latency of the memory 230 is generated so that the frequent memory access request may be an important cause of the slow artificial neural processing speed.


That is, even though the operation processing speed of the processor 210 is fast, if the latency is generated to take data necessary for the operation, the processor 210 may be in an idle state in which the operation is not performed. Therefore, in this case, the operation processing speed of the processor 210 may become slow.


Therefore, the artificial neural network memory system according to the examples of the present disclosure may be configured to improve the bandwidth and/or the latency of the memory 230.



FIG. 9 illustrates an operation of a memory system according to a comparative embodiment of the present disclosure.


Referring to FIG. 9, the processor generates the data access request, and a known memory system may transmit a memory access request corresponding to the data access request to the memory. At this time, the memory has a latency so that the processor may be provided with the requested data from the memory after waiting for the period of latency.


For example, the known memory system receives a data access request [1] generated by the processor and transmits the memory access request [1′] corresponding to the data access request [1] to the memory. The memory may transmit the data [1″]to the memory system after the latency. Accordingly, a processing time of the processor may be delayed as much as the latency of the memory at every data access request. Accordingly, the time of the inference operation of the artificial neural network may be delayed as much as the memory latency. Specifically, as the processor generates more data access requests, the artificial neural network inference operation time of the known memory system may be further delayed.



FIG. 10 illustrates an operation of a memory system according to FIG. 8.


Referring to FIG. 10, the processor 210 generates a data access request [1] and the artificial neural network memory controller 220 may transmit the memory access request corresponding to the predicted data access request generated based on the artificial neural network data locality pattern to the memory 230. At this time, even though the memory 230 has a latency, the processor 210 generates a memory access request corresponding to the predicted data access request so that when the processor 210 generates the subsequent data access request, the artificial neural network memory controller 220 may directly provide the data requested by the processor 210 to the processor 210.


For example, the data access request [1] generated by the processor 210 is received by the artificial neural network memory controller 220 to generate the predicted data access request [2] and transmit the memory access request [2′] corresponding to the predicted data access request [2] to the memory 230. The memory 230 may transmit the data [2″] to the artificial neural network memory controller 220 after the latency. However, the data [2″] provided by the memory 230 is data corresponding to the memory access request [2′] based on the predicted data access request [2]. Accordingly, when the processor 210 generates the subsequent data access request [2], the artificial neural network memory controller 220 may immediately provide the data [2″] to the processor 210.


If a time between the memory access request based on the predicted data access request and the subsequent data access request is longer than the latency of the memory 230, the artificial neural network memory controller 220 may provide the data to the processor 210 as soon as the subsequent data access request is received from the processor 210. In this case, the artificial neural network memory controller 220 may substantially eliminate the latency of the memory 230.


In other words, when the memory access request based on the predicted data access request is transmitted to the memory 230, the latency of the memory 230 may be shorter than or equal to a time from the generation of the predicted data access request to the generation of the subsequent data access request. In this case, the artificial neural network memory controller 220 may immediately provide data without causing the latency as soon as the processor 210 generates the subsequent data access request.


Even though the time between the memory access request based on the predicted data access request and the subsequent data access request is shorter than the latency of the memory 230, the latency of the memory 230 may be substantially reduced as much as the time between the memory access request and the subsequent data access request.


According to the above-described configuration, the artificial neural network memory controller 220 may substantially eliminate or reduce the latency of the data to be provided to the processor 210.


In some examples, the artificial neural network memory controller of the artificial neural network memory system may be configured to measure the latency of the memory or be provided with a latency value of the memory from the memory.


According to the above-described configuration, the artificial neural network memory controller may be configured to determine a timing of generating a memory access request based on the predicted data access request, based on the latency of the memory. Accordingly, the artificial neural network memory controller may generate a memory access request based on the predicted data access request which substantially minimizes the latency of the memory.


In some examples, the memory of the artificial neural network memory system may be a memory configured to include a refresh function which updates a voltage of a memory cell. The artificial neural network memory controller may be configured to selectively control the refresh to the memory address area of the memory corresponding to the memory access request corresponding to the predicted data access request. For example, the memory may be a DRAM including a refresh function.


If the DRAM does not refresh the voltage of the memory cell, the memory cell is slowly discharged so that the stored data may be lost. Accordingly, the voltage of the memory cell needs to be refreshed at every specific cycle. If the timing of the memory access request of the artificial neural network memory controller and the refresh timing overlap, the artificial neural network memory system may be configured to advance or delay the timing of refreshing the voltage of the memory cell.


The artificial neural network memory system may predict or calculate the timing of generating the memory access request based on the artificial neural network data locality pattern. Accordingly, the artificial neural network memory system may be configured to limit the voltage refresh of the memory cell during the memory access request operation.


In other words, the inference operation of the artificial neural network operation operates with the concept of accuracy, so that even though the stored data is partially lost due to the delayed refresh of the voltage of the memory cell, the degradation of the inference accuracy may be substantially negligible.


According to the above-described configuration, the artificial neural network memory system may be provided with the data in accordance with the memory access request from the memory by adjusting the voltage refresh cycle of the memory cell.


Accordingly, the operation speed lowering of the artificial neural network in accordance with the voltage refresh of the memory cell may be improved without substantially degrading the inference accuracy.


In some examples, the memory of the artificial neural network memory system may be configured to further include a precharge function which charges a global bit line of the memory with a specific voltage. At this time, the artificial neural network memory controller may be configured to selectively provide the precharge to the memory address area of the memory corresponding to the memory access request corresponding to the predicted data access request.


In some examples, the artificial neural network memory controller may be configured to precharge or delay the bit line of the memory which performs a memory task corresponding to the predicted data access request based on the artificial neural network data locality pattern.


Generally, the memory performs the precharge operation to perform a read operation or a write operation by receiving the memory access request. When one memory operation is completed, signals remain in the bit line which performs the data read and write operations and each data input/output line so that only when the above-mentioned lines are precharged to a predetermined level, a subsequent memory operation may be smoothly performed. However, since the time required for precharge is quite long, when the timing of generating a memory access request and the timing of precharge overlap, the memory operation may be delayed by the precharge time. Accordingly, the time for processing the data access request requested by the processor may be delayed.


The artificial neural network memory controller may predict that a memory operation is performed on a bit line of a specific memory at a specific order based on the artificial neural network data locality pattern. Accordingly, the artificial neural network memory controller may advance or delay the precharge timing so as not to overlap the precharge timing and a time when the memory operation is performed on a specific bit line.


In other words, the inference operation of the artificial neural network model operates with the concept of accuracy, so that even though the stored data is partially lost due to the delayed precharge, the degradation of the inference accuracy may be substantially negligible.


In other words, the artificial neural network is a mathematical model modeled by simulating a brain neural network of a biological system. A human nerve cell called a neuron exchanges information through a junction between nerve cells called synapses and the information exchange between the nerve cells is very simple, but a massive number of nerve cells are gathered to create the intelligence. This structure has advantages in that, even though some nerve cells transmit wrong information, it does not affect the overall information so that it is very robust against small errors. Therefore, due to the above-described characteristic, even though the precharge and refresh functions of the memory which stores the data of the artificial neural network model are selectively limited, the accuracy of the artificial neural network model may not substantially cause problems and the memory latency due to the precharge or the refresh may be reduced.


According to the above-described configuration, the operation speed lowering of the artificial neural network in accordance with the precharge may be improved without substantially degrading the inference accuracy.


In some examples, the artificial neural network memory controller may be configured to independently control the refresh function and the precharge function of the memory based on the artificial neural network data locality pattern.



FIG. 11 illustrates an artificial neural network memory system 300 according to still another example of the present disclosure.


Referring to FIG. 11, the artificial neural network memory system 300 may be configured to include a processor 310, an artificial neural network memory controller 320 including a cache memory 322, and a memory 330. The processor 110, 210, or 310 may further comprise a special function unit (SFU) as illustrated in FIG. 15A.


The artificial neural network memory system 300 and the artificial neural network memory system 200 are substantially the same except that the artificial neural network memory system 300 further includes the cache memory 322. Therefore, for the convenience of description, the redundant description will be omitted.


The artificial neural network memory system 300 may be configured to include an artificial neural network memory controller 320 including a cache memory 322 configured to store data transmitted by the memory 330 in response to a memory access request based on a predicted data access request.


According to the above-described configuration, the artificial neural network memory controller 320 may read data in response to the memory access request based on the predicted data access request from the memory 330 and store the data in the cache memory 322. Therefore, when the processor 310 generates a subsequent data access request, the artificial neural network memory controller 320 may immediately provide the data stored in the cache memory 322 to the processor 310.


A latency of the cache memory 322 is much shorter than the latency of the memory 330. A bandwidth of the cache memory 322 is higher than the bandwidth of the memory 330.


An artificial neural network model processing performance of the artificial neural network memory system 300 including a cache memory 322 may be better than the artificial neural network memory system 200.


The artificial neural network memory system 300 will be described with reference to the artificial neural network model 1300 of FIG. 3.


The artificial neural network model 1300 may be compiled by a specific compiler to be operated in the processor 310. The compiler may be configured to provide the artificial neural network data locality pattern to the artificial neural network memory controller 320.


In order to infer the artificial neural network model 1300, the processor 310 may be configured to generate data access requests according to the order based on the artificial neural network data locality. Accordingly, the artificial neural network memory controller 320 may monitor the data access requests to generate the artificial neural network data locality pattern 1400. Alternatively, the artificial neural network memory controller 320 may store an artificial neural network data locality pattern 1400 which has been generated in advance.


Hereinafter, an example in which an artificial neural network data locality pattern 1400 is not generated will be described.


First, the processor 310 may generate a data access request of a token [1] corresponding to a node value read mode of the input layer 1310. Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [1] to transmit the node value of the input layer 1310 which is transmitted from the memory 330 to the processor 310.


Next, the processor 310 may generate a data access request of a token [2] corresponding to a weight value of the first connection network 1320. Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [2] to transmit the weight value of the first connection network 1320 which is transmitted from the memory 330 to the processor 310.


Next, the processor 310 receives the node value of the input layer 1310 and the weight value of the first connection network 1320 to calculate the node value of the first hidden layer 1330. That is, the processor 310 may generate a data access request of a token [3] corresponding to a node value write mode of the first hidden layer 1330. Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [3] to store the node value of the first hidden layer 1330 in the memory 330.


Next, the processor 310 may generate a data access request of a token [4] corresponding to a node value read mode of the first hidden layer 1330. Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [4] to transmit the node value of the first hidden layer 1330 which is transmitted from the memory 330 to the processor 310.


Next, the processor 310 may generate a data access request of a token [5] corresponding to a weight value of the second connection network 1340. Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [5] to transmit the weight value of the second connection network 1340 which is transmitted from the memory 330 to the processor 310.


Next, the processor 310 receives the node value of the first hidden layer 1330 and the weight value of the second connection network 1340 to calculate the node value of the second hidden layer 1350. That is, the processor 310 may generate a data access request of a token [6] corresponding to a node value write mode of the second hidden layer 1350. Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [6] to store the node value of the second hidden layer 1350 in the memory 330.


Next, the processor 310 may generate a data access request of a token [7] corresponding to a node value read mode of the second hidden layer 1350.


Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [7] to transmit the node value of the second hidden layer 1350 which is transmitted from the memory 330 to the processor 310.


Next, the processor 310 may generate a data access request of a token [8] corresponding to a weight value of the third connection network 1360. Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [8] to transmit the weight value of the third connection network 1360 which is transmitted from the memory 330 to the processor 310.


Next, the processor 310 receives the node value of the second hidden layer 1350 and the weight value of the third connection network 1360 to calculate the node value of the output layer 1370. That is, the processor 310 may generate a data access request of a token [9] corresponding to a node value write mode of the output layer 1370. Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [9] to store the node value of the output layer 1370 in the memory 330.


Accordingly, the artificial neural network memory system 300 may store the inference result of the artificial neural network model 1300 in the output layer 1370.


In the above-described example, the artificial neural network data locality pattern 1400 has not been generated in the artificial neural network memory controller 320. Therefore, according to the above-described example, the predicted data access request cannot be generated. Accordingly, since the artificial neural network memory controller 320 does not provide the data in advance, the latency of the memory 330 may be caused in every memory access request.


However, since the artificial neural network memory controller 320 records the data access requests, when the processor 310 generates the data access request of the token [1] corresponding to a node value read mode of the input layer 1310 again, the artificial neural network data locality pattern 1400 may be generated.


Hereinafter, generation of the artificial neural network data locality pattern 1400 is described with reference to FIG. 4.


In the following example, the artificial neural network data locality pattern 1400 is generated and the processor 310 is repeatedly inferring the artificial neural network model 1300, but the present disclosure is not limited thereto.


The processor 310 detects the repeated data access request of the token [1] to generate the artificial neural network data locality pattern 1400. In other words, since the artificial neural network memory controller 320 sequentially stores from the token [1] to the token [9], when the artificial neural network memory controller 320 detects the token [1] again, the artificial neural network data locality may be determined.


However, as described above, the artificial neural network memory controller according to the examples of the present disclosure is not limited to the token. The token is merely used for the convenience of description and the examples of the present disclosure may be implemented by the identification information included in the data access request and the memory access request.


For example, when the processor 310 generates the data access request corresponding to the token [9], the artificial neural network memory controller 320 generates the predicted data access request of the token [1]. Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [1] to store the node value of the input layer 1310 in the cache memory 322 in advance.


That is, if the data access request of the token [9] is the final step of the artificial neural network model 1300, the artificial neural network memory controller 320 may predict that the data access request of the token [1], which is a start step of the artificial neural network model 1300, will be generated.


Next, when the processor 310 generates a data access request of the token [1], the artificial neural network memory controller 320 determines whether the predicted data access request of the token [1] and the data access request of the token [1] are the same. When it is determined that the requests are the same, the node value of the input layer 1310 stored in the cache memory 322 may be immediately provided to the processor 310.


At this time, the artificial neural network memory controller 320 generates the predicted data access request of the token [2].


Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [2] to store the weight value of the first connection network 1320 in the cache memory 322 in advance.


Next, when the processor 310 generates a data access request of the token [2], the artificial neural network memory controller 320 determines whether the predicted data access request of the token [2] and the data access request of the token [2] are the same. When it is determined that the requests are the same, the node value of the first connection network 1320 stored in the cache memory 322 may be immediately provided to the processor 310.


At this time, the artificial neural network memory controller 320 generates the predicted data access request of the token [3].


Next, the processor 310 receives the node value of the input layer 1310 and the weight value of the first connection network 1320 to calculate the node value of the first hidden layer 1330. When the processor 310 generates a data access request of the token [3], the artificial neural network memory controller 320 determines whether the predicted data access request of the token [3] and the data access request of the token [3] are the same. When it is determined that the requests are the same, the calculated node value of the first hidden layer 1330 may be stored in the memory 330 and/or the cache memory 322.


The cache memory 322 will be additionally described. When the same data is stored in the memory 330 as the memory access request of the token [3] without having the cache memory 322, and then is read from the memory 330 as the memory access request of the token [4], the latency of the memory 330 may be doubled.


In this case, the artificial neural network memory controller 320 stores the node value of the layer calculated based on the fact that the memory address values of continuous tokens are the same and an operation mode of a previous token is a write mode, and an operation mode of the subsequent token is a read mode and determines to use the corresponding node value as an input value of a subsequent layer.


That is, when the data of the token [3] is stored in the cache memory 322, the data access requests corresponding to the token [3] and the token [4] may be processed in the cache memory 322. Accordingly, the artificial neural network memory controller 320 may be configured so as not to generate the memory access requests corresponding to the data access request of the token [3] and the data access request of the token [4]. According to the above-described configuration, the latency of the memory 330 by the memory 330 may be eliminated by the memory access request of the token [3] and the memory access request of the token [4]. In particular, the cache memory 322 operation policy may be performed based on the artificial neural network data locality pattern 1400.


At this time, the artificial neural network memory controller 320 generates the predicted data access request of the token [4].


Next, when the processor 310 generates a data access request of the token [4], the artificial neural network memory controller 320 determines whether the predicted data access request of the token [4] and the data access request of the token [4] are the same. When it is determined that the requests are the same, the node value of the first hidden layer 1330 stored in the cache memory 322 may be immediately provided to the processor 310.


At this time, the artificial neural network memory controller 320 generates the predicted data access request of the token [5].


Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [5] to store the weight value of the second connection network 1340 in the cache memory 322 in advance.


Next, when the processor 310 generates a data access request of the token [5], the artificial neural network memory controller 320 determines whether the predicted data access request of the token [5] and the data access request of the token [5] are the same. When it is determined that the requests are the same, the weight value of the second connection network 1340 stored in the cache memory 322 may be immediately provided to the processor 310.


At this time, the artificial neural network memory controller 320 generates the predicted data access request of the token [6].


Next, the processor 310 receives the node value of the first hidden layer 1330 and the weight value of the second connection network 1340 to calculate the node value of the second hidden layer 1350. When the processor 310 generates a data access request of the token [6], the artificial neural network memory controller 320 determines whether the predicted data access request of the token [6] and the data access request of the token [6] are the same. When it is determined that the requests are the same, the calculated node value of the second hidden layer 1350 may be stored in the memory 330 and/or the cache memory 322.


At this time, the artificial neural network memory controller 320 generates the predicted data access request of the token [7].


Next, when the processor 310 generates a data access request of the token [7], the artificial neural network memory controller 320 determines whether the predicted data access request of the token [7] and the data access request of the token [7] are the same. When it is determined that the requests are the same, the node value of the second hidden layer 1350 stored in the cache memory 322 may be immediately provided to the processor 310.


At this time, the artificial neural network memory controller 320 generates the predicted data access request of the token [8].


Accordingly, the artificial neural network memory controller 320 generates the memory access request of the token [8] to store the weight value of the third connection network 1360 in the cache memory 322 in advance.


Next, when the processor 310 generates a data access request of the token [8], the artificial neural network memory controller 320 determines whether the predicted data access request of the token [8] and the data access request of the token [8] are the same. When it is determined that the requests are the same, the weight value of the third connection network 1360 stored in the cache memory 322 may be immediately provided to the processor 310.


At this time, the artificial neural network memory controller 320 generates the predicted data access request of the token [9].


Next, the processor 310 receives the node value of the second hidden layer 1350 and the weight value of the third connection network 1360 to calculate the node value of the output layer 1370. When the processor 310 generates a data access request of the token [9], the artificial neural network memory controller 320 determines whether the predicted data access request of the token [9] and the data access request of the token [9] are the same. When it is determined that the requests are the same, the calculated node value of the output layer 1370 may be stored in the memory 330 and/or the cache memory 322.


Accordingly, the artificial neural network memory system 300 may store the inference result of the artificial neural network model 1300 in the output layer 1370.


Even though the inference of the artificial neural network model 1300 ends by the artificial neural network data locality pattern 1400, the artificial neural network memory system 300 may be prepared to immediately start the next inference.


That is, the artificial neural network memory system 300 of FIG. 11 may be configured to generate a predicted data access request based on the artificial neural network data locality, determine whether the predicted data access request and an actual data access request are the same, and if the requests are the same, further generate a next predicted data access request. According to the above-described configuration, the artificial neural network memory controller 320 may eliminate or reduce the latency of the memory 330 at the time of processing the data access request.


In some examples, the artificial neural network memory controller may be configured to operate to minimize an available space of the cache memory by generating at least one predicted data access request.


That is, the artificial neural network memory controller compares the memory available space of the cache memory and a size of the data value to be stored and when the memory available space of the cache memory is present, generates at least one predicted data access request to minimize the available space of the cache memory.


That is, the artificial neural network memory controller may be configured to generate a plurality of predicted data access requests in accordance with a capacity of the cache memory.


That is, the artificial neural network memory controller may be configured to sequentially generate at least one memory access request based on a remaining capacity of the cache memory to minimize the remaining capacity of the cache memory.


The example will be described with reference to FIGS. 2 to 6. When the processor generates a data access request of the token [1], the artificial neural network memory controller generates a predicted data access request of the token [2] to store the weight value of the first connection network 1320 in the cache memory in advance. Next, the artificial neural network memory controller may allocate a space for storing and reading the node value calculating result of the first hidden layer 1330 corresponding to the token [3] and the token [4] to the cache memory in advance. Next, the artificial neural network memory controller may store the weight value of the second connection network 1340 corresponding to the token [5] in the cache memory in advance. When there is a margin in the cache memory, the artificial neural network memory controller may be configured to further generate sequentially the predicted data access request based on the artificial neural network data locality pattern. That is, when there is a margin in the capacity of the cache memory, the artificial neural network memory controller may be configured to store weight values in the cache memory in advance based on the artificial neural network data locality pattern or ensure an area to store the artificial neural network operation result in advance.


If the capacity of the cache memory is sufficient, weight values of all connection networks of the artificial neural network model 1300 may be stored in the cache memory. Specifically, in the case of the artificial neural network model which completes the learning, the weight values are fixed. Accordingly, when the weight values reside in the cache memory, the latency of the memory caused by the memory access request to read the weight values may be eliminated.


According to the above-described configuration, the data required for the cache memory is stored based on the artificial neural network data locality to optimize an operational efficiency of the cache memory and improve the processing speed of the artificial neural network memory system 300.


According to the above-described configuration, the cache memory sequentially generates the predicted data access request in consideration of both the artificial neural network data locality pattern and the capacity of the cache memory so that the processing speed of the artificial neural network memory system may be improved.


According to the above-described configuration, when the processor generates a specific data access request included in the artificial neural network data locality pattern 1400, the artificial neural network memory controller may sequentially predict at least one data access request after the specific data access request. For example, when the processor generates the data access request of the token [1], the artificial neural network memory controller may predict that corresponding data access requests are generated in the order of tokens [2-3-4-5-6-7-8-9].


According to the above-described configuration, the artificial neural network memory controller 320 may cause the specific weight values to reside in the cache memory for a specific period. For example, when the processor infers at a speed of 30 times per second by utilizing the artificial neural network model, the weight value of the specific layer may reside in the cache memory. In this case, the artificial neural network memory controller may reutilize the weight value stored in the cache memory for every inference. Accordingly, the corresponding memory access request may be selectively deleted. Accordingly, the latency in accordance with the memory access request may be eliminated.


In some examples, the cache memory may be configured by a plurality of layered cache memories. For example, the cache memory may include a cache memory configured to store the weight value or a cache memory configured to store a feature map.


In some examples, when the artificial neural network data locality pattern 1400 is generated, the artificial neural network memory controller may be configured to predict the weight value and the node value based on the identification information included in the data access request. Accordingly, the artificial neural network memory controller may be configured to identify the data access request corresponding to the weight value. Specifically, when it is assumed that the learning is completed so that a weight value of the connection network is fixed, in the artificial neural network data locality pattern 1400, the weight value may be configured to operate only in the read mode. Accordingly, the artificial neural network memory controller may determine the token [2], the token [5], and the token [8] as weight values. In other words, the token [1] is a start step of the inference so that it may be determined as an input node value. In other words, the token [9] is a last step of the inference so that it may be determined as an output node value. In other words, the tokens [3] and [4] have orders of the write mode and the read mode of the same memory address value so that the tokens [3] and [4] may be determined as a node value of the hidden layer. However, it may vary depending on the artificial neural network data locality of the artificial neural network model.


The artificial neural network memory controller may be configured to analyze the artificial neural network data locality pattern to determine whether the data access request is a weight value, a kernel window value, a node value, an activation map value, or the like of the artificial neural network model.


In some examples, the artificial neural network memory system includes a processor configured to generate a data access request corresponding to the artificial neural network operation, an artificial neural network memory controller configured to store an artificial neural network data locality pattern generated by a compiler and generate a predicted data access request, which predicts a subsequent data access request of the data access request generated by the processor based on the artificial neural network data locality pattern; and a memory configured to communicate with the artificial neural network memory controller. The memory may be configured to operate in accordance with the memory access request output from the artificial neural network memory controller.


According to the above-described configuration, the artificial neural network memory controller may be configured to be provided with the artificial neural network data locality pattern generated from the compiler. In this case, the artificial neural network memory controller may allow the data access requests of the artificial neural network model, which is being processed by the processor, to be prepared in the cache memory in advance based on the artificial neural network data locality pattern generated by the compiler. Specifically, the artificial neural network data locality pattern generated by the compiler may be more accurate than the artificial neural network data locality pattern generated by monitoring the artificial neural network data locality.


In other words, the artificial neural network memory controller may be configured to respectively store the artificial neural network data locality pattern generated by the compiler and the artificial neural network data locality pattern generated by independently monitoring the data access request.



FIG. 12 illustrates exemplary identification information of a data access request.


A data access request generated by a processor according to the examples of the present disclosure may be configured to further include at least one piece of additional identification information. The additional identification information may also be referred to as a side band signal or side band information.


A data access request generated by the processor may be an interface signal with a specific structure. That is, the data access request may be an interface signal for the communication of the processor and the artificial neural network memory controller. The data access request may be configured to further include an additional bit to additionally provide identification information required for the artificial neural network operation, but the present disclosure is not limited thereto, and the additional identification information may be provided in various ways.


In some examples, the data access request of the artificial neural network memory system may be configured to further include identification information to identify whether it is an artificial neural network operation, but the examples of the present disclosure are not limited thereto.


For example, the artificial neural network memory system adds one bit of identification code to the data access request to identify whether the data access requests received by the artificial neural network memory controller is a data access request related to the artificial neural network operation. However, the number of bits of the identification code according to the examples of the present disclosure is not limited and may be adjusted in accordance with the number of cases of an object to be identified.


For example, when the identification code is [0], the artificial neural network memory controller may determine that the corresponding data access request is related to the artificial neural network operation.


For example, when the identification code is [1], the artificial neural network memory controller may determine that the corresponding data access request is not related to the artificial neural network operation.


In this case, the artificial neural network memory controller may be configured to generate the artificial neural network data locality pattern by recording only the data access request related to the artificial neural network operation based on the identification information included in the data access request. According to the above-described configuration, the artificial neural network memory controller may not record the data access request which is not related to the artificial neural network operation. By doing this, the accuracy of the artificial neural network data locality pattern generated by recording the data access requests may be improved, but the examples of the present disclosure are not limited thereto.


In some examples, the data access request of the artificial neural network memory system may be configured to further include identification information to identify whether the artificial neural network operation is an operation for learning or an operation for inference, but the examples of the present disclosure are not limited thereto.


For example, the artificial neural network memory system adds one bit of identification code to the data access request so that the data access requests received by the artificial neural network memory controller are configured to identify whether an operation type of the artificial neural network model is learning or inference. However, the number of bits of the identification code according to the examples of the present disclosure is not limited and may be adjusted in accordance with the number of cases of an object to be identified.


For example, when the identification code is [0], the artificial neural network memory controller may determine that the corresponding data access request is a learning operation.


For example, when the identification code is [1], the artificial neural network memory controller may determine that the corresponding data access request is an inference operation.


In this case, the artificial neural network memory controller may be configured to generate the artificial neural network data locality pattern by individually recording the data access request of the learning operation and the data access request of the inference operation. For example, in the learning mode, an evaluation step of updating each layer of the artificial neural network model and/or the weight values of the kernel window and determining an inference accuracy of the trained artificial neural network model may be further included. Accordingly, even though the structures of the artificial neural network models are the same, the artificial neural network data locality to be processed by the processor may be different in the learning operation and the inference operation.


According to the above-described configuration, the artificial neural network memory controller may be configured to separately generate the artificial neural network data locality pattern of the learning mode and the artificial neural network data locality pattern of the inference mode of the specific artificial neural network model. By doing this, the accuracy of the artificial neural network data locality pattern generated by recording the data access requests by the artificial neural network memory controller may be improved, but the examples of the present disclosure are not limited thereto.


In some examples, the data access request of the artificial neural network memory system may be configured with an operation mode including identification information to identify the memory read operation and the memory write operation, but not limited thereto, so that the data access request of the artificial neural network memory system may be configured with an operation mode which further includes the identification information to identify the overwrite operation and/or protective operation, but the examples of the present disclosure are not limited thereto.


For example, one bit of identification code is added to the data access request of the artificial neural network memory system to include the read operation and the write operation. Alternatively, two bits of identification code are added to the data access request of the artificial intelligence network memory system to identify the read operation, the write operation, the overwrite operation, and the protective operation. However, the number of bits of the identification code according to the examples of the present disclosure is not limited and may be adjusted in accordance with the number of cases of an object to be identified.


In other words, for the operation of the artificial neural network memory system, the data access request needs to include identification information to identify the memory address value and the read operation, and the write operation. The artificial neural network memory controller receives the data access request to generate a corresponding memory access request to perform the memory operation.


For example, when the identification code is [00], the artificial neural network memory controller may determine the corresponding data access request as a read operation.


For example, when the identification code is [01], the artificial neural network memory controller may determine the corresponding data access request as a write operation.


For example, when the identification code is [10], the artificial neural network memory controller may determine the corresponding data access request as an overwrite operation.


For example, when the identification code is [11], the artificial neural network memory controller may determine the corresponding data access request as a protective operation.


However, the above examples of the present disclosure are not limited thereto.


According to the above-described configuration, the artificial neural network memory controller controls the memory in accordance with the read mode or the write mode to be provided with various data of the artificial neural network model or store the data in the memory.


According to the above-described configuration, the artificial neural network memory controller may update the weight value of the specific layer by the overwrite mode during the learning operation of the artificial neural network. Specifically, the updated weight value is stored in the same memory address value so that a new memory address may not be allocated. Accordingly, the overwrite mode may be more effective than the write mode during the learning operation.


According to the above-described configuration, the artificial neural network memory controller may protect data stored in the specific memory address by a protective mode. Specifically, in an environment in which a plurality of users are accessing, like ae server, the data of the artificial neural network model may not be arbitrarily eliminated. Further, the weight values of the artificial neural network model which ends the learning may be protected with the protective mode.


In some examples, the data access request of the artificial neural network memory system may be configured to further include identification information capable of identifying inference data, a weight, a feature map, a learning data set, an evaluation data set, and others, but the examples of the present disclosure are not limited thereto.


For example, the artificial neural network memory system may be configured to add three bits of identification code to the data access request to allow the artificial neural network memory controller to identify a domain of the data to access. However, the number of bits of the identification code according to the examples of the present disclosure is not limited and may be adjusted in accordance with the number of cases of an object to be identified.


For example, when the identification code is [000], the artificial neural network memory controller may determine that the corresponding data is data which is not related to the artificial neural network model.


For example, when the identification code is [001], the artificial neural network memory controller may determine that the corresponding data is the inference data of the artificial neural network model.


For example, when the identification code is [010], the artificial neural network memory controller may determine that the corresponding data is the feature map of the artificial neural network model.


For example, when the identification code is [011], the artificial neural network memory controller may determine that the corresponding data is the weight of the artificial neural network model.


For example, when the identification code is [100], the artificial neural network memory controller may determine that the corresponding data is the learning data set of the artificial neural network model.


For example, when the identification code is [101], the artificial neural network memory controller may determine that the corresponding data is the inference data set of the artificial neural network model.


According to the above-described configuration, the artificial neural network memory controller may be configured to identify the domain of the data of the artificial neural network model and to allocate an address of a memory in which data corresponding to the domain is stored. For example, the artificial neural network memory controller may set a starting address and the end address of the memory area allocated to the domain. According to the above-described configuration, the data allocated to the domain may be stored to correspond to the order of the artificial neural network data locality pattern.


For example, data of the domain of the artificial neural network model may be sequentially stored in the memory area allocated to the domain. At this time, the memory may be a memory which supports a read-burst function. According to the above-described configuration, when the artificial neural network memory controller reads data of a specific domain from the memory, the specific data may be configured to be stored in accordance with the artificial neural network data locality pattern to be optimized for the read-burst function. That is, the artificial neural network memory controller may be configured to set the storage area of the memory in consideration of the read-burst function.


In some examples, the memory further includes a read-burst function and at least one artificial neural network memory controller may be configured to write the storage area of at least one memory in consideration of the read-burst function.


In some examples, the data access request of the artificial neural network memory system may be configured to further include identification information to identify the quantization of the artificial neural network model, but the examples of the present disclosure are not limited thereto.


For example, when the data access request includes at least the memory address value, the domain, and the quantization identification information, the artificial neural network memory system may be configured to identify the quantization information of the data of the domain.


For example, when the identification code is [00001], the artificial neural network memory controller may determine that the corresponding data is data quantized to one bit.


For example, when the identification code is [11111], the artificial neural network memory controller may determine that the corresponding data is data quantized to 32 bits.


In some examples, various identification information may be selectively included in the data access request.


According to the above-described configuration, the artificial neural network memory controller analyzes the identification code of the data access request to generate a more accurate artificial neural network data locality pattern. Further, each identification information is figured out to selectively control the storage policy of the memory.


For example, when the learning and the inference are identified, each artificial neural network data locality pattern may be generated.


For example, when the domain of the data is identified, a policy of storing the data of the artificial neural network data locality pattern in a specific memory area is established to improve the efficiency of the memory operation.


In some examples, when the artificial neural network memory system is configured to process a plurality of artificial neural network models, the artificial neural network memory controller may be configured to further generate identification information of the artificial neural network model, for example, additional identification information, such as a first artificial neural network model or a second artificial neural network model. At this time, the artificial neural network memory controller may be configured to distinguish the artificial neural network model based on the artificial neural network data locality of the artificial neural network model, but the present disclosure is not limited thereto.


The sideband signal and artificial neural network (ANN) data locality information shown in FIG. 12 may be selectively integrated or separated.


Artificial Neural Network Calculation: it is possible to determine whether ANN operation of the corresponding data is performed in the SAM MEMORY CONTROLLER.


Operation type: it is possible to determine whether the corresponding data is training or inference in the SAM MEMORY CONTROLLER. (Schedule for weight value update in inference mode.)


Operation mode: RAM can be controlled in the SAM MEMORY CONTROLLER (in the case of the kernel, it can be refreshed by looking at the domain, and in the case of the feature map, it can be read-discarded)


DOMAIN: may be information required for MEMORY MAP setting in SAM


MEMORY CONTROLLER. (DOMAIN may allocate the same data to a specific area according to ANN data locality information.)


Quantization: The SAM MEMORY CONTROLLER may provide quantization information of the corresponding data.


ANN MODEL #: SAM MEMORY CONTROLLER may allocate each model to MEMORY MAP according to ANN data locality information. The minimum ANN's total DATA size can be secured.


MULTI-THREAD: The SAM MEMORY CONTROLLER may share the kernel and allocate individual feature maps, respectively, according to the number of THREADs of each ANN MODEL.


ANN data locality: information meaning a specific processing stage of the data locality information of the ANN.


On the other hand, all sideband signals may be implemented as PACKET.



FIG. 13 is a diagram for explaining energy consumption per unit operation of an artificial neural network memory system.


Referring to FIG. 13, in a table, an energy consumed per unit operation of the artificial neural network memory system 300 is schematically explained. The energy consumption may be explained to be divided into a memory access, an addition operation, and a multiplication operation.


“8b Add” refers to 8-bit integer addition operation of an adder. The 8-bit integer addition operation may consume energy of 0.03 pj.


“16b Add” refers to 16-bit integer addition operation of an adder. The 16-bit integer addition operation may consume energy of 0.05 pj.


“32b Add” refers to 32-bit integer addition operation of an adder. The 32-bit integer addition operation may consume energy of 0.1 pj.


“16b FP Add” refers to 16-bit floating point addition operation of an adder. The 16-bit floating point addition operation may consume energy of 0.4 pj.


“32b FP Add” refers to 32-bit floating point addition operation of an adder. The 32-bit floating point addition operation may consume energy of 0.9 pj.


“8b Mult” refers to 8-bit integer multiplication operation of a multiplier. The 8-bit integer multiplication operation may consume energy of 0.2 pj.


“32b Mult” refers to 32-bit integer multiplication operation of a multiplier. The 32-bit integer multiplication operation may consume energy of 3.1 pj.


“16b FP Mult” refers to 16-bit floating point multiplication operation of a multiplier. The 16-bit floating point multiplication operation may consume energy of 1.1 pj.


“32b FP Mult” refers to 32-bit floating point multiplication operation of a multiplier. The 32-bit floating point multiplication operation may consume energy of 3.7 pj.


“32b SRAM Read’ refers to 32-bit data read access when the cache memory 322 of the artificial neural network memory system 300 is a static random access memory (SRAM). An energy of 5 pj may be consumed to read 32 bits of data from the cache memory 322 to the processor 310.


“32b DRAM Read’ refers to 32-bit data read access when the memory 330 of the artificial neural network memory system 300 is a DRAM. An energy of 640 pj may be consumed to read 32 bits of data from the memory 330 to the processor 310. The energy unit is picojoules (pj).


When the 32-bit floating point multiplication and 8-bit integer multiplication which are performed by the artificial neural network memory system 300 are compared, the difference in the energy consumed per unit operation is approximately 18.5 times. When 32-bit data is read from the memory 330 configured by the DRAM and 32-bit data is read from the cache memory 322 configured by the SRAM, the difference in the energy consumed per unit operation is approximately 128 times.


That is, from the viewpoint of the power consumption, the larger the bit size of the data, the more the power consumption. Further, when the floating point operation is used, the power consumption is increased more than the integer operation. Further, when the data is read from the DRAM, the power consumption is rapidly increased.


In the artificial neural network memory system 300 according to still another example of the present disclosure, a capacity of the cache memory 322 may be configured to be enough to store all the data values of the artificial neural network model 1300.


The cache memory according to the examples is not limited to the SRAM. Examples of the static memories which are capable of performing a high speed operation like the SRAM include SRAM, MRAM, STT-MRAM, eMRAM, OST-MRAM, and the like. Moreover, MRAM, STT-MRAM, eMRAM, and OST-MRAM are static memories having a non-volatile characteristic. Accordingly, when the power of the artificial neural network memory system 300 is shut off and then rebooted, the artificial neural network model 1300 does not need to be provided from the memory 330 again, but the examples according to the present disclosure are not limited thereto.


According to the above-described configuration, when the artificial neural network memory system 300 performs the inference operation of the artificial neural network model 1300 based on the artificial neural network data locality pattern 1400, the power consumption due to the reading operation of the memory 330 may be significantly reduced.



FIG. 14 is a schematic diagram for explaining an artificial neural network memory system according to various examples of the present disclosure.


Hereinafter, various examples according to the present disclosure will be described with reference to FIG. 14. FIG. 14 may explain the number of various cases in which various examples according to the present disclosure may be carried out.


According to various examples of the present disclosure, an artificial neural network memory system 400 includes at least one processor, at least one memory, and at least one artificial neural network memory controller AMC configured to include at least one processor and receive a data access request from at least one processor to provide the memory access request to at least one memory. The at least one AMC may be configured to be substantially the same as the exemplary artificial neural network memory controllers 120, 220, and 320. However, it is not limited thereto, and one artificial neural network memory controller of the artificial neural network memory system 400 may be configured to be different from the other artificial neural network memory controllers. Hereinafter, the repeated description of the artificial neural network memory controllers 411, 412, 413, 414, 415, 416, and 517 and the above-described artificial neural network memory controllers 120, 220, and 320 will be omitted for the convenience of description.


The at least one artificial neural network memory controller is configured to connect at least one processor and at least one memory. At this time, in a data transferring path between at least one processor and at least one memory, there may be a corresponding artificial neural network data locality. Accordingly, the artificial neural network memory controller located in the data transferring path may be configured to extract the corresponding artificial neural network data locality pattern.


Each AMC may be configured to monitor each data access request to generate an artificial neural network data locality pattern. The artificial neural network memory system 400 may be configured to include at least one processor. The at least one processor may be configured to process the artificial neural network operation alone or in cooperation with other processors.


The artificial neural network memory system 400 may be configured to include at least one internal memory. The artificial neural network memory system 400 may be configured to be connected to at least one external memory. The internal memory or the external memory may include a dynamic RAM (DRAM), a high bandwidth memory (HBM), a static RAM (SRAM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), a flash memory, a ferroelectric RAM (FRAM), a flash memory, a magnetic RAM (MRAM), a hard disk, a phase change memory device (phase change RAM), and the like, but the present disclosure is not limited thereto.


External memory (External MEM 1, External MEM 2) or internal memory (Internal MEM1, Internal MEM2) can communicate with the artificial neural network memory system 400 via corresponding memory interface (External MEM I/F).


A processor (Processor 1) can include bus interface unit (BIU) communicating with a system bus.


The artificial neural network memory system 400 may include an external memory interface connected to the external memory (External MEM). The external memory interface transmits the memory access request to at least one external memory of the artificial neural network memory system 400 and may receive data in response to the memory access request from the at least one external memory. The configurations and functions disclosed in the exemplary artificial neural network memory controllers 120, 220, and 320 are distributed to a plurality of artificial neural network memory controllers 411, 412, 413, 414, 415, 416, and 517 to be disposed in a specific position of the artificial neural network memory system 400. In some examples, the processor may be configured to include an artificial neural network memory controller.


In some examples, the memory may be a DRAM and, in this case, the artificial neural network memory controller may be configured to be included in the DRAM.


For example, at least one of the artificial neural network memory controllers 411, 412, 413, 414, 415, 416, and 517 may be configured to include a cache memory. Further, the cache memory may be configured to be included in the processor, the internal memory and/or the external memory.


For example, at least one of the artificial neural network memory controllers 411, 412, 413, 414, 415, 416, and 517 may be configured to be distributed in the data transferring path between the memory and the processor.


For example, the artificial neural network memory controller which may be implemented in the artificial neural network memory system 400 may be configured by one of an independently configured artificial neural network memory controller 411, an artificial neural network memory controller 412 included in the system bus, an artificial neural network memory controller 413 configured as an interface of the processor, an artificial neural network memory controller 414 included in a wrapper block between the memory interface of the internal memory and the system bus, an artificial neural network memory controller included in the memory interface of the internal memory, an artificial neural network memory controller 415 included in the internal memory, an artificial neural network memory controller included in a memory interface corresponding to the external memory, an artificial neural network memory controller 416 included in the wrapper block between the memory interface of the external memory and the system bus and/or an artificial neural network memory controller 517 included in the external memory. However, the artificial neural network memory controller according to the examples of the present disclosure is not limited thereto.


For example, individual artificial neural network data locality patterns generated by the first artificial neural network memory controller 411 and the second artificial neural network memory controller 412 may be the same or may be different from each other.


In other words, the first artificial neural network memory controller 411 may be configured to connect a first processor (Processor 1) and a first internal memory internal MEM1 by means of the system bus. At this time, in the data transferring path between the first processor (Processor 1) and the first internal memory internal MEM1, there may be a first artificial neural network data locality.


In such case, the third artificial neural network memory controller 413 is illustrated in said path. However, it is merely illustrative and the third artificial neural network memory controller 413 may be omitted. That is, when at least one artificial neural network memory controller is disposed between the processor and the memory, the artificial neural network data locality pattern of the artificial neural network model which is processed by the processor may be generated.


In other words, the second artificial neural network memory controller 412 may be configured to connect a second processor (Processor 2) and a first external memory external MEM1. At this time, in the data transferring path between the second processor (Processor 2) and the first external memory external MEM1, there may be a second artificial neural network data locality.


For example, a first artificial neural network model which is processed by the first processor (Processor 1) may be an object recognition model and a second artificial neural network model which is processed by the second processor (Processor 2) may be a voice recognition model. Accordingly, the artificial neural network models may be different from each other, and corresponding artificial neural network data locality patterns may also be different from each other.


That is, the artificial neural network data locality patterns generated by the artificial neural network memory controllers 411, 412, 413, 414, 415, 416, and 517 may be determined in accordance with a pattern characteristic of the data access request generated by the corresponding processor.


That is, even though the artificial neural network memory controller of the artificial neural network memory system 400 is disposed between an arbitrary processor and an arbitrary memory, the artificial neural network memory controller may provide adaptability to generate the artificial neural network data locality pattern in the corresponding position. In other words, when two processors cooperate to process one artificial neural network model in parallel, the artificial neural network data locality pattern of the artificial neural network model may be divided to be assigned to each processor. For example, a convolution operation of a first layer is processed by a first processor and a convolution operation of a second layer is processed by a second processor to distribute the operation of the artificial neural network model. In this case, even though the artificial neural network model is the same, the artificial neural network data locality of the artificial neural network model processed by the respective processors may be reconstructed in the unit of the data access request. In this case, each artificial neural network memory controller may provide adaptability to generate an artificial neural network data locality pattern corresponding to the data access request of the processor which is processed by the artificial neural network memory controller.


According to the above-described configuration, even though the plurality of artificial neural network memory controllers is distributed between a plurality of processors and a plurality of memories, the performance of the artificial neural network memory system 400 may be optimized by the artificial neural network data locality patterns generated to be suitable for each situation. That is, each artificial neural network memory controller analyzes the artificial neural network data locality in its position to be optimized for the artificial neural network operation which is variably processed in real time.


In some examples, at least one of the artificial neural network memory controllers 411, 412, 413, 414, 415, 416, and 517 may be configured to confirm at least one information of the number of memories, a memory type, an effective bandwidth of a memory, a latency of a memory, and a memory size.


In some examples, at least one of the artificial neural network memory controllers 411, 412, 413, 414, 415, 416, and 517 may be configured to measure an effective bandwidth of a memory which responds to the memory access request. Here, the memory may be at least one memory and each artificial neural network memory controller may measure an effective bandwidth of a channel which communicates with each memory. The effective bandwidth may be calculated by measuring a time that the artificial neural network memory controller generates a memory access request and the memory access request ends and a data transfer bit rate.


In some examples, at least one of the artificial neural network memory controllers 411, 412, 413, 414, 415, 416, and 517 may be configured to be provided with a necessary bandwidth of at least one memory which responds to the memory access request.


In some examples, the artificial neural network memory system 400 includes a plurality of memories and at least one artificial neural network memory controller may be configured to measure effective bandwidths of the plurality of memories.


In some examples, the artificial neural network memory system 400 includes a plurality of memories and at least one artificial neural network memory controller may be configured to measure the latencies of the plurality of memories.


That is, at least one artificial neural network memory controller may be configured to perform auto-calibration of memories connected thereto. The auto-calibration may be configured to be executed when the artificial neural network memory system starts or at a specific cycle. At least one artificial neural network memory controller may be configured to collect information such as the number of memories connected thereto, a type of the memory, an effective bandwidth of the memory, a latency of the memory, and a size of the memory, by means of the auto-calibration.


According to the above-described configuration, the artificial neural network memory system 400 may know the latency and the effective bandwidth of the memory corresponding to the artificial neural network memory controller.


According to the above-described configuration, even though an independent artificial neural network memory controller is connected to the system bus, an artificial neural network data locality of an artificial neural network model which is being processed by the processor is generated to control the memory.


In some examples, at least one artificial neural network memory controller of the artificial neural network memory system 400 may be configured to calculate a time taken to repeat the artificial neural network data locality pattern one time and a data size to calculate an effective bandwidth required for the artificial neural network operation. Specifically, when all the data access requests included in the artificial neural network data locality pattern are processed, it is determined that the processor completes the inference of the artificial neural network model. The artificial neural network memory system 400 may be configured to measure a time taken to one inference based on the artificial neural network data locality pattern to calculate the number of inferences per second (IPS). Further, the artificial neural network memory system 400 may be provided with target inference number per second information from the processor. For example, a specific application requires 30 IPS as the inference rate of a specific artificial neural network model. If the measured IPS is lower than a target IPS, the artificial neural network memory controller 400 may be configured to operate to improve the artificial neural network model processing speed of the processor.


In some examples, the artificial neural network memory system 400 may be configured to include a system bus configured to control communication of an artificial neural network memory controller, a processor, and a memory. Further, at least one artificial neural network memory controller may be configured to have a master authority of the system bus.


In other words, the artificial neural network memory system 400 may not be a dedicated device for the artificial neural network operation. In this case, various peripheral devices such as wifi devices, displays, cameras, or microphones may be connected to the system bus of the artificial neural network memory system 400. In this case, the artificial neural network memory system 400 may be configured to control the bandwidth of the system bus for stable artificial neural network operation.


In some examples, at least one artificial neural network memory controller may operate to preferentially process the artificial neural network operation for the processing time of the memory access request and process operations other than the artificial neural network operation for the other time.


In some examples, at least one artificial neural network memory controller may be configured to ensure an effective bandwidth of the system bus until at least one memory completes a memory access request.


In some examples, at least one artificial neural network memory controller is disposed in the system bus and the system bus may be configured to dynamically change the bandwidth of the system bus based on the artificial neural network data locality pattern generated in the system bus.


In some examples, at least one artificial neural network memory controller is disposed in the system bus and at least one artificial neural network memory controller may be configured to increase the control authority of the system bus to be higher than that when there is no memory access request, until at least one memory completes the response for the memory access request.


In some examples, at least one artificial neural network memory controller may be configured to set a priority of a data access request of a processor which processes an artificial neural network operation, among a plurality of processors, to be higher than that of a processor which processes an operation other than the artificial neural network operation.


In some examples, the artificial neural network memory controller may be configured to directly control the memory.


In some examples, the artificial neural network memory controller is included in the memory and the artificial neural network memory controller may be configured to generate at least one access queue. The artificial neural network memory controller may be configured to separately generate an access queue dedicated for the artificial neural network operation.


In some examples, at least one of the plurality of memories may be a DRAM. In this case, at least one artificial neural network memory controller may be configured to readjust the access queue of the memory access requests. The access queue readjustment may be an access queue re-order.


In some examples, the artificial neural network memory controller may be configured to include an access queue of a plurality of memory access requests. In this case, the first access queue may be an access queue dedicated to the artificial neural network operation and the second access queue may be an access queue for operations other than the artificial neural network operation. The artificial neural network memory controller may be configured to provide data by selecting each access queue in accordance with the priority setting.


In some examples, at least one artificial neural network memory controller may be configured to calculate a specific bandwidth required for the system bus to process a specific memory access request based on the artificial neural network data locality pattern, and at least one artificial neural network memory controller may be configured to control the effective bandwidth of the system bus based on the specific bandwidth.


According to the above-described configuration, the artificial neural network memory system 400 may be configured to lower the priority of the memory access requests of various peripheral devices or raise a priority of a predicted data access request based on the artificial neural network data locality pattern.


According to the above-described configuration, the artificial neural network memory controller readjusts the processing order of the data access request of the system bus to fully utilize the bandwidth of the system bus while the artificial neural network operation is processed and to yield the bandwidth for processing data of other peripheral devices when there is no artificial neural network operation.


According to the above-described configuration, the artificial neural network memory controller may readjust the processing sequence of the data access request based on the artificial neural network data locality pattern. Further, the artificial neural network memory controller readjusts the priority based on identification information included in the data access request. That is, from the viewpoint of the artificial neural network operation, the effective bandwidth of the system bus dynamically varies so that the effective bandwidth may be improved. Accordingly, an operation efficiency of the system bus may be improved. Accordingly, the effective bandwidth of the system bus may be improved from the viewpoint of the artificial neural network memory controller.


In some examples, at least one artificial neural network memory controller may be configured to perform machine learning of the data access request. That is, at least one artificial neural network memory controller may further include an artificial neural network model which is configured to machine-learn the artificial neural network data locality pattern. That is, the artificial neural network data locality pattern is machine-learned so that specific patterns, whereby another data access request is interrupted in the middle of the data access request processing according to the actual artificial neural network data locality, are learned in order to be predicted.


When a predicted data access request is generated, the artificial neural network model embedded in the artificial neural network memory controller may be machine-trained to increase the control authority of the system bus to be higher than when the predicted data access requests are not generated.


In some examples, at least one artificial neural network memory controller further includes a plurality of layered cache memories and at least one artificial neural network memory controller may be configured to perform machine-learning of data access requests between layers of the plurality of layered cache memories.


In some examples, at least one artificial neural network memory controller may be configured to be provided with at least one of an effective bandwidth, a power consumption, and latency information of each layer of the plurality of layered cache memories.


According to the above-described configuration, the artificial neural network memory controller may be configured to generate an artificial neural network data locality pattern by means of the machine learning and the machine-learned artificial neural network data locality pattern may improve a probability of predicting a specific pattern occurrence when various data access requests regardless of the artificial neural network operation are generated with the specific pattern. Further, characteristics of various artificial neural network models and other operations processed by the processor are predicted by the reinforcement learning to improve the efficiency of the artificial neural network operation.


In some examples, at least one artificial neural network memory controller may be configured to divide and store data to be stored in the plurality of memories based on the effective bandwidth and the latency of each of the plurality of memories.


For example, data is configured by L bits of bit groups and a plurality of memories includes a first memory and a second memory. The first memory is configured to divide and store M bits of data from the L bits of bit groups based on a first effective bandwidth or a first latency and the second memory is configured to divide and store N bits of data from the L bits of bit groups based on a second effective bandwidth or a second latency. The sum of M bits and N bits may be configured to be smaller than or equal to the L bits. Further, the plurality of memories further includes a third memory and the third memory is configured to store 0 bits of data from the L bits of bit groups based on a third effective bandwidth or a third latency, and the sum of the M bits, N bits, and 0 bits may be configured to be equal to the L bits.


For example, the data is configured by P data packets and a plurality of memories includes a first memory and a second memory. The first memory is configured to store R data packets among P data packets based a first effective bandwidth or a first latency and the second memory is configured to store S data packets among P data packets based a second effective bandwidth or a second latency.


The sum of R and S may be configured to be smaller than or equal to P. In addition, the plurality of memories further includes a third memory and the third memory is configured to store T data packets from the P data packets based on a third effective bandwidth or a third latency, and the sum of R, S, and T may be configured to be equal to P.


According to the above-described configuration, when a bandwidth of one memory is low, the artificial neural network memory controller may distribute the data to be stored or read, so that the effective bandwidth of the memory may be improved. For example, the artificial neural network memory controller may be configured to divide 8 bits of quantized weight value to store or read 4 bits in the first memory and 4 bits in the second memory. Accordingly, the effective bandwidth of the memory may be improved from the viewpoint of the artificial neural network memory controller.


The artificial neural network memory controller may be configured to further include a cache memory which is configured to merge and store data which is divided to be stored in the plurality of memories. That is, at least one artificial neural network memory controller further includes a cache memory and may be configured to merge data distributed to be stored in the plurality of memories to store the merged data in the cache memory. Accordingly, the processor may be provided with the merged data.


In order to merge the divided data, at least one artificial neural network memory controller may be configured to store division information of the data which is divided to be stored in the plurality of memories. Various examples of the present disclosure will be described as follows.


According to one example of the present disclosure, the artificial neural network memory system may be configured to include at least one processor configured to generate a data access request corresponding to the artificial neural network operation and at least one artificial neural network memory controller configured to generate an artificial neural network data locality pattern of an artificial neural network operation by sequentially recording the data access request and to generate a predicted data access request which predicts a subsequent data access request of the data access request generated by at least one processor based on the artificial neural network data locality pattern. Here, the artificial neural network data locality is an artificial neural network data locality which is reconstructed at a processor-memory level.


According to the examples of the present disclosure, the artificial neural network memory system may be configured to include at least one processor configured to process the artificial neural network model and at least one artificial neural network memory controller configured to store artificial neural network data locality information of an artificial neural network model and to predict data to be requested by at least one processor based on the artificial neural network data locality information to generate a predicted data access request.


The artificial neural network memory system may be configured to further include at least one memory and a system bus configured to control communication of the artificial neural network memory controller, at least one processor, and at least one memory. According to the example of the present disclosure, the artificial neural network memory system includes a processor, a memory, and a cache memory and is configured to generate a predicted data access request including data to be requested by the processor based on the artificial neural network data locality information and store data corresponding to the predicted data access request from the memory in the cache memory before the processor requests.


According to the example of the present disclosure, the artificial neural network memory system may be configured to operate in either one of a first mode configured to operate by receiving the artificial neural network data locality information and a second mode configured to operate by observing data access requests generated by the processor to predict the artificial neural network data locality information.


At least one artificial neural network memory controller may be configured to sequentially further generate a predicted data access request based on the artificial neural network data locality pattern.


At least one artificial neural network memory controller may be configured to generate a predicted data access request before generating a subsequent data access request.


At least one processor may be configured to transmit a data access request to at least one artificial neural network memory controller.


At least one artificial neural network memory controller may be configured to output a predicted data access request in response to a data access request.


The data access request may be configured to further include a memory address.


The data access request may be configured to further include a start address and an end address of the memory.


At least one artificial neural network memory controller may be configured to generate a memory access request based on one of the data access request generated by at least one processor and the predicted data access request generated by the artificial neural network memory controller.


The data access request may be configured to further include a start address of the memory and a continuous data read trigger.


The data access request may be configured to further include a start address of the memory and information of the number of continuous data.


The data access request and the predicted data access request may be configured to further include a data access request token of the same matching memory address.


The data access request may be configured to further include identification information to identify whether it is a memory read command or a write command.


The data access request may be configured to further include identification information to identify whether it is a memory overwrite command.


The data access request may be configured to further include identification information to identify whether it is inference data, weight data, or feature map data.


The data access request may be configured to further include identification information to identify whether it is learning data or evaluation data.


The data access request may be configured to further include identification information to identify whether the artificial neural network operation is an operation for learning or an operation for inference.


When at least one processor generates a subsequent data access request, at least one artificial neural network memory controller may be configured to determine whether a predicted data access request and a subsequent data access request are the same requests.


When the predicted data access request and the subsequent data access request are the same requests, at least one artificial neural network memory controller may be configured to maintain the artificial neural network data locality pattern.


When the predicted data access request and the subsequent data access request are different, at least one artificial neural network memory controller may be configured to update the artificial neural network data locality pattern.


The artificial neural network data locality pattern may be configured to further include data in which addresses of the memory of the data access requests are sequentially recorded.


At least one artificial neural network memory controller may be configured to generate the artificial neural network data locality pattern by detecting the repeated pattern of the memory address included in the data access request.


The artificial neural network data locality pattern may be configured by memory addresses having a repeated loop characteristic.


The artificial neural network data locality pattern may be configured to further include identification information for identifying the start and the end of the operation of the artificial neural network model.


At least one processor may be configured to be provided with data corresponding to the data access request from the artificial neural network memory controller.


At least one artificial neural network memory controller may be configured to further include an artificial neural network model which is configured to machine-learn the artificial neural network data locality pattern.


At least one artificial neural network memory controller may be configured to store an updated pattern and an advance pattern of the artificial neural network data locality pattern to determine whether the artificial neural network model is changed.


At least one artificial neural network memory controller may be configured to determine whether the data access requests are requests of one artificial neural network model or are mixtures of the requests of the plurality of artificial neural network models.


When there is a plurality of artificial neural network models, at least one artificial neural network memory controller may be configured to further generate artificial neural network data locality patterns corresponding to the number of artificial neural network models.


At least one artificial neural network memory controller may be configured to individually generate corresponding predicted data access requests based on the artificial neural network data locality patterns.


At least one artificial neural network memory controller may be configured to further generate a data access request corresponding to the data access request.


At least one artificial neural network memory controller may be configured to further generate a data access request corresponding to the predicted data access request.


Each of the data access request, the predicted data access request, and the memory access request may be configured to include the corresponding memory address value and operation mode.


At least one artificial neural network memory controller may be configured to further generate a memory access request including at least a part of information included in the data access request and the predicted data access request.


At least one memory configured to communicate with at least one artificial neural network memory controller is further included, and at least one memory may be configured to operate in response to the memory access request output from at least one artificial neural network memory controller.


At least one memory may be configured to store at least one of inference data, weight data, and feature map data.


At least one neural network artificial neural network memory controller may be configured to further include a cache memory configured to store data transmitted from at least one memory in response to the memory access request.


When at least one processor outputs a subsequent data access request, at least one artificial neural network memory controller determines whether the predicted data access request and the subsequent (i.e., next) data access request are the same requests. If the predicted data access request and the subsequent data access request are the same, at least one artificial neural network memory controller may be configured to provide data stored in the cache memory to at least one processor and if the predicted data access request and the subsequent data access request are not the same, at least one artificial neural network memory controller may be configured to generate a new memory access request based on the subsequent data access request.


At least one artificial neural network memory controller sequentially generates at least one memory access request based on a remaining capacity of the cache memory to minimize the remaining capacity of the cache memory.


At least one artificial neural network memory controller may be configured to measure an effective bandwidth of at least one memory which responds to the memory access request.


At least one artificial neural network memory controller may be configured to be provided with a necessary bandwidth of at least one memory which responds to the memory access request.


At least one artificial neural network memory controller may be configured to measure the number of inferences per second (IPS) of the artificial neural network operation by calculating the number of repeating times of the artificial neural network data locality patterns for a specific time.


At least one artificial neural network memory controller may be configured to calculate a time taken to repeat the artificial neural network data locality pattern one time and a data size to calculate an effective bandwidth required for the artificial neural network operation.


At least one memory further includes a DRAM including a refresh function to update a voltage of a memory cell and at least one artificial neural network memory controller may be configured to selectively control the refresh of a memory address area of at least one memory corresponding to the memory access request corresponding to the predicted data access request.


At least one memory further includes a precharge function to charge a global bit line of the memory with a specific voltage and at least one artificial neural network memory controller may be configured to selectively provide precharge to a memory address area of at least one memory corresponding to the memory access request corresponding to the predicted data access request.


At least one memory further includes a plurality of memories and at least one artificial neural network memory controller may be configured to measure effective bandwidths of the plurality of memories, respectively.


At least one memory further includes a plurality of memories and at least one artificial neural network memory controller may be configured to measure latencies of the plurality of memories, respectively.


At least one memory further includes a plurality of memories and at least one artificial neural network memory controller may be configured to divide and store data to be stored in the plurality of memories based on the effective bandwidth and the latency of each of the plurality of memories.


Data is configured by L bits of bit groups and a plurality of memories further includes a first memory and a second memory. The first memory is configured to divide and store M bits of data from the L bits of bit groups based on a first effective bandwidth or a first latency and the second memory is configured to divide and store N bits of data from the L bits of bit groups based on a second effective bandwidth or a second latency. The sum of M bits and N bits may be configured to be smaller than or equal to the L bits.


The plurality of memories further includes a third memory and the third memory is configured to store 0 bits of data from the L bits of bit groups based on a third effective bandwidth or a third latency, and the sum of the M bits, N bits, and 0 bits may be configured to be equal to the L bits.


At least one artificial neural network memory controller may be configured to further include a cache memory which is configured to merge and store data which is divided to be stored in the plurality of memories.


Data is configured by P data packets, and a plurality of memories includes a further first memory and a second memory. The first memory is configured to store R data packets among P data packets based a first effective bandwidth or a first latency and the second memory is configured to store S data packets among P data packets based a second effective bandwidth or a second latency. The sum of R and S may be configured to be smaller than or equal to P.


The plurality of memories further include a third memory and the third memory is configured to store T data packets from the P data packets based on a third effective bandwidth or a third latency, and the sum of R, S, and T may be configured to be equal to P.


At least one memory further includes a plurality of memories, and at least one artificial neural network memory controller further includes a cache memory and is configured to merge data distributed to be stored in the plurality of memories to store the merged data in the cache memory.


At least one memory further includes a plurality of memories, and at least one artificial neural network memory controller may be configured to store divided information of the data which is divided to be stored in the plurality of memories.


At least one artificial neural network memory controller may be configured to store a part of the data in the cache memory as much as the latency, based on the predicted data access request and the latency value of at least one memory.


At least one artificial neural network memory controller may be configured to store a part of the data in the cache memory based on the predicted data access request and a required data bandwidth of at least one memory.


When at least one processor generates a subsequent data access request, at least one artificial neural network memory controller provides data stored in cache memory first and controls the remaining data in a read-burst mode, from at least one memory, to reduce the latency of at least one memory.


When at least one processor generates a subsequent data access request based on the predicted data access request and the latency value of at least one memory, at least one artificial neural network memory controller starts with a read-burst mode of at least one memory in advance by as much as the latency value, to reduce the latency of at least one memory.


A system bus configured to control communication of the artificial neural network memory controller, at least one processor, and at least one memory may be further included.


At least one artificial neural network memory controller may be configured to have a master authority of the system bus.


At least one artificial neural network memory controller further includes an artificial neural network model and, when a predicted data access request is generated, the artificial neural network model may be machine-trained to increase the control authority of the system bus to be higher than when the predicted data access requests are not generated.


At least one artificial neural network memory controller may be configured to ensure an effective bandwidth of the system bus until at least one memory completes a memory access request.


At least one artificial neural network memory controller may be configured to calculate a specific bandwidth required for the system bus to process a specific memory access request based on the artificial neural network data locality pattern and at least one artificial neural network memory controller may be configured to control the effective bandwidth of the system bus based on the specific bandwidth.


At least one artificial neural network memory controller is disposed in the system bus, and the system bus is configured to dynamically change the bandwidth of the system bus based on the artificial neural network data locality pattern generated in the system bus.


At least one artificial neural network memory controller may operate to preferentially process the artificial neural network operation for the processing time of the memory access request and to process operations other than the artificial neural network operation for the other time.


At least one artificial neural network memory controller and at least one processor may be configured to directly communicate with each other.


The artificial neural network memory controller may be configured to further include a first access queue which is an access queue dedicated to the artificial neural network operation, and a second access queue which is an access queue other than the artificial neural network operation and the artificial neural network memory controller may be configured to select the access queue in accordance with the priority setting to provide data.


At least one artificial neural network memory controller further includes a plurality of layered cache memories and at least one artificial neural network memory controller may be configured to further include an artificial neural network model which is configured to perform machine-learning of data access requests between layers of the plurality of layered cache memories.


At least one artificial neural network memory controller may be configured to be further provided with at least one of an effective bandwidth, a power consumption, and latency information of each layer of the plurality of layered cache memories.


At least one processor configured to generate a data access request corresponding to the artificial neural network operation, at least one artificial neural network memory controller configured to store an artificial neural network data locality pattern of an artificial neural network operation generated from a compiler and generate a predicted data access request which predicts a subsequent data access request of the data access request generated by at least one processor based on the artificial neural network data locality pattern, and at least one memory configured to communicate with at least one artificial neural network memory controller are included. At least one memory may be configured to operate in accordance with the memory access request output from at least one artificial neural network memory controller.


At least one artificial neural network memory system may be configured to further include at least one memory and a system bus configured to control communication of an artificial neural network memory controller, at least one processor, and at least one memory.


At least one artificial neural network memory controller is disposed in the system bus, and at least one artificial neural network memory controller may be configured to increase the control authority of the system bus to be higher than that when there is no memory access request, until at least one memory completes the response for the memory access request.


The at least one artificial neural network memory controller includes one or more artificial neural network memory controllers that are configured to be included in the DRAM.


The at least one artificial neural network memory controller includes one or more artificial neural network memory controllers that are configured to be included in at least one processor.


At least one memory further includes a DRAM or at least one memory is DRAM and at least one artificial neural network memory controller may be configured to readjust an access queue of the memory access request. That is, at least one artificial neural network memory controller may be configured to control a reorder cue of the memory controller of the DRAM.


An artificial neural network operation-related memory access request provided from the artificial neural network memory controller to the memory controller of the memory may further include priority information which can be interpreted by the memory controller of the memory.


According to the above-described configuration, the memory controller of the memory may be configured to reorder the memory access queue in the memory controller based on the priority information included in the memory access request generated by the artificial neural network memory controller regardless of whether the memory access request is related to the artificial neural network operation. Accordingly, the access queue of the memory access request for processing the artificial neural network operation may be processed earlier than the access queue of another type of memory access request. Accordingly, the artificial neural network memory controller may increase the effective bandwidth of the corresponding memory.


The memory access request processing order determined by the memory controller of the DRAM may be readjusted by the priority information provided by the artificial neural network memory controller.


For example, when the priority of the memory access request generated by the artificial neural network memory controller is set to be urgent, the memory controller of the DRAM may change the processing sequence of the memory access request to a first priority.


The artificial neural network memory controller may be configured to generate at least one access queue.


At least one memory includes an artificial neural network memory controller, and the artificial neural network memory controller may be configured to separately generate the access queue dedicated to the artificial neural network operation.


At least one artificial neural network memory controller may be configured to readjust the access queue of the memory access requests.


At least one memory further includes a read-burst function, and at least one artificial neural network memory controller may be configured to set the storage area of at least one memory in consideration of the read-burst function.


At least one memory further includes a read-burst function, and at least one artificial neural network memory controller may be configured to process the write operation in the storage area of at least one memory in consideration of the read-burst function.


At least one processor further includes a plurality of processors, and at least one artificial neural network memory controller may be configured to set a priority of a data access request of a processor which processes an artificial neural network operation, among a plurality of processors, to be higher than that of a processor which processes an operation other than the artificial neural network operation.


For example, a processor according to the present disclosure may be configured with one of the exemplary NPUs of the present disclosure. For example, the SoC according to the present disclosure may include an artificial neural network memory system. Hereinafter, the NPU and SoC will be described later.



FIG. 15A is a schematic diagram illustrating an artificial neural network memory system according to various examples of the present disclosure.


Referring to FIG. 15A, a neural processing unit NPU and at least one internal memory may be included in a part of a system on chip (SoC).


The SoC may further include a main processor and various common modules as needed. A typical module may be a Bluetooth device, a USB device, a PCI interface, an AXI interface, a video interface, an UART interface, an audio interface, a DDR memory, and the like.


The interface bus is a path for transmitting data between components of the SoC, and may be determined by the characteristics and operating speed of the data and required functions. An Advanced eXtensible Interface (AXI) bus is intended for high performance, high clock frequency system design. Therefore, it can be suitable for data transfer between NPU, DRAM and high-speed interface IP such as USB and PCIe.


An NPU and/or an AMC may be included in the SoC. For example, the SoC may include a CPU, a BUS architecture, a memory, a Clock Reset Manager (CRM), a Direct Memory Access (DMA), and the like. In addition, the SoC may further include a General-Purpose Input/Output (GPIO), high-speed interfaces such as USB and PCIe required for high-speed data transmission and reception, serial interfaces such as UART and SPI, a video interface and an audio interface for exchanging video and audio signals.


The CPU may be selected according to the target application, circuit characteristics such as power consumption, operating speed, required system functions of the CPU, and supported arithmetic functions or instruction sets.


Depending on the purpose and characteristics of the SoC, the presence or absence of operating system support, and DSP operation and floating-point operation support may be considered for selecting the CPU. In addition, a DSP operation function may be required for implementing a novel neural network algorithm other than conventional neural network algorithms that have been implemented in the NPU.


In order for SoC to be applied to the field of object detection, tasks such as pre-processing and post-processing of the input image may be required, and in such case, the CPU may support an OS having a framework capable of operating an image processing.


The internal memory may be a static memory. For example, the internal memory may be a SRAM. The NPU and the internal memory may be connected through an SRAM interface.


Since SRAM has relatively larger memory cell size compared to DRAM, it is difficult to design a large-capacity SRAM. Hence, the internal SRAM size can be optimized and DRAM can be used for the rest. In this case, the AMC may optimize the bandwidth of the NPU and the main memory based on the ANN data locality information.


The internal memory may refer to a memory formed on a silicon substrate of the SoC.


There may be at least one internal memory. For example, the internal memory may include a first internal memory for storing weights, a second internal memory for storing an input feature map, and a third internal memory for storing an output feature map. The second internal memory and the third internal memory may be referred to as an internal feature map memory. The three internal memories may be a plurality of logical areas allocated in one physical memory.


The NPU may include a PE array including a plurality of processing elements (PE) and a special function unit (SFU). The SFU may perform a function of selectively applying an activation function to the result of the convolution performed on the PE array. According to the above configuration, the PE array may process the convolution operation, and the SFU may process the activation function operation.


The NPU may read a weight from the first internal memory and an input feature map from the second internal memory and may perform a convolution operation with the input feature map and the weights by the PE array. The NPU then outputs an output feature map to which an activation function may be selectively applied in the SFU. Further, the SFU of the NPU may store the output feature map in the third internal memory.


In addition, at least one main memory may exist inside and/or outside the SoC. The main memory may be a memory of the various examples as described above, for example, a DRAM. In this case, the at least one main memory and the internal memory may be connected through a DRAM interface. For example, the DRAM interface may be an AXI interface.


The DRAM may be a standard DDR, a mobile DDR, or a graphic DDR.


Further, it is also possible to implement a high bandwidth memory (HBM) as the main memory.


A DRAM module (DIMM) composed of standard DRAM may be used in PC or server-class devices. A mobile DDR (LPDDR) is available for edge devices. The mobile DDR may be LPDDR4 or LPDDR5.


The main memory may include a first main memory for storing weights and a second main memory for storing a feature map. The first and second main memories may be realized as a plurality of areas allocated within one physical memory.


The SoC may read the weight in the first main memory and the feature map in the second main memory through a read command, and store the weight and the feature map in the first internal memory and the second internal memory, respectively. Also, the SoC may store the output feature map from the third internal memory to the second main memory through a write command.


However, when the main memory is a dynamic memory, for example, in the case of DRAM, latencies such as column address strobe (CAS) latency and row address strobe (RAS) latency may occur. In particular, when data stored in the main memory is randomly fragmented and processed by a virtual memory, there is a disadvantage in that it is difficult for the DRAM to perform burst read/write operations. In particular, in the case of artificial neural network computation with a large amount of data, this problem can be a key problem that rapidly degrades the overall computational performance. In the following examples, the main memory may be a dynamic memory.



FIG. 15B shows the detailed operation configuration of the SFU of FIG. 15A.


The SFU shown in FIG. 15B may be configured to include a plurality of sub-modules. The SFU can select each module to perform the necessary activation function or special function operation.


The SFU may change the format of data to be processed inside the NPU.


For example, integers can be converted to floating points. For example, quantization can be performed with a specific bit-widths. For example, an activation function can be applied to the result of the convolution operation.


An example of each operation configuration of the SFU of FIG. 15A may be organized in the following table.












TABLE 1







Description
Operation


















Zero point add
Offset addition by Filter or Tensor
Int add



(Dequantize offset operation)


Int2float
Type casting


Scale
Scale Multiply by Filter or Tensor
Float mul



(Dequantize offset operation)


Bias add
Add bias value for each filter
Float add


Batch
Floating point values for each filter and
Float mul



mul/add. Scale factor and zero point are
Float add



fusing


Skip add
Block previous output and element wise add
Float add



(Skip connection add)


Activation
Activation Function


SE mul
SE block output and previous output and
Float mul



channel wise multiplication (SE module



output and multiply)


Avgpool
After Accumulate feature dimension divide
Float add




Float Mul


Quantize
Zero-point addition, scale multiply
Float add




Float Mul


Float2Int
Type casting










FIG. 16 illustrates the structure and operation of the DRAM as the main memory shown in FIG. 15A.


As can be seen with reference to FIG. 16, the DRAM may include a plurality of banks, for example, eight banks and a buffer. For detailed explanations for elements of the DRAM, reference may be made to FIGS. 29 and 30.


Each bank may include a plurality of memory cells including a predetermined number of rows and columns. One memory cell can store one bit of data. An address for a column and a row may be used to control a memory cell identified by a specific row and a specific column.


When an address is received along with a read command, the DRAM latches bit values of memory cells in a specific row to the sense amplifier. For the above operation, RAS latency occurs once. Thereafter, information on a memory cell in a specific column is read from the latched sense amplifier. For the above operation, CAS latency occurs once. That is, DRAM suffers from RAS latency for latching bit values to the sense amplifier whenever row is changed.


For example, if the address points to the second cell identified by the second column of the first row, the DRAM reads, for example, a bit value corresponding to the second column latched in each sense amplifier corresponding to each bank, and transfers the bit value from the sense amplifier to the buffer.


For example, if the address indicates the third cell identified as the third column of the first row, the DRAM reads the bit value corresponding to the third column latched by the eight sense amplifiers of the eight banks, respectively, and transfers it to the buffer,


That is, in case of the above-described second and third cell, since data necessary for the sense amplifier are latched, an additional RAS latency is not needed. Therefore, burst-read operation is possible.


For example, the buffer receives and combines the bit values of each bank of addresses of the same row and column. For example, 8-bit data can be combined by reading one bit value from eight banks for one clock period, respectively. For example, 8-bit data can be combined by reading the bit data of the second cell from each bank, and then 8-bit data can be combined by reading the value of the third cell from each bank.


In the above examples, addresses of the same row and different columns are provided. However, since each sense amplifier corresponding to each bank latches data of all memory cells of the selected row, the data latched in the sense amplifier can be sequentially read. Therefore, when data stored in the same row is latched by the sense amplifier, a burst read operation is possible. Therefore, the operation speed according to the burst read may be improved.


On the other hand, if the memory cells to be read are in different rows, the burst read operation may not be performed. A burst read operation means reading a large number of bits at once. A burst read operation is possible within one row. In the example of FIG. 16, cell 1 and cell 4 are located in different rows. Therefore, separate RAS latency occurs in order to latch the value corresponding to each row to the sense amplifier, and the effective bandwidth of DRAM is lowered due to RAS latency.


Therefore, data stored in the main memory, which is DRAM, must be stored in consideration of the rows and columns of the DRAM bank so that a burst read operation is possible.


In order to enable the burst read operation, artificial neural network (ANN) data locality information, defined according to the sequence in which the NPU performs an operation, is required.


In addition, if the ANN data locality information is analyzed or provided, it is possible to know all of the sequence of the data requests required for the artificial neural network operation requested by the NPU. Therefore, it is possible to directly control the address of the DRAM to enable burst reading from the DRAM.


The ANN data locality information may not be defined for each layer of the artificial neural network model, but may refer to the sequence of data requested by the NPU.


That is, the artificial neural network memory system may determine the sequence of the data read request to be generated by the NPU based on the ANN data locality information. If the main memory is a dynamic memory having a RAS latency and a CAS latency, the artificial neural network memory system may store data of the artificial neural network model in the dynamic memory for minimizing the latency of the dynamic memory.



FIG. 17 shows an architecture of a system according to the first example.


Referring to FIG. 17, an NPU, an artificial neural network memory controller (AMC), and a main memory that is an external memory are shown. In some cases, the main memory may be referred to as an external memory.


For convenience of description below, the artificial neural network memory controller of various examples of the present disclosure may be referred to as an AMC.


The NPU may include an NPU scheduler, an internal memory and a PE array. The NPU may further include the SFU shown in FIG. 15A.


The PE array may perform an operation for an artificial neural network. For example, when input data is input, the PE array may perform an operation of deriving an inference result through an artificial neural network. In some examples, a plurality of processing element may be configured to operate independently from each other.


The NPU scheduler may be configured to control the operation of the PE array for the inference operation of the NPU and the read and write sequence of the NPU internal memory. In addition, the NPU scheduler may be configured to control the PE array and the NPU internal memory based on ANN data locality information.


The NPU scheduler may analyze the structure of the artificial neural network model to be operated in the PE array or may receive the analyzed information. For example, the compiler of the NPU may be configured to analyze the artificial neural network data locality. The data that the artificial neural network model may include includes at least an input feature map of each layer according to the locality of the artificial neural network data, a kernel, and an output feature map. Each layer may be selectively tiled according to the size of the layer and the size of the internal memory.


The ANN data locality information may be stored in a memory provided inside the NPU scheduler or the NPU internal memory. The NPU scheduler can access the main memory to read or write necessary data. In addition, the NPU scheduler may utilize the ANN data locality information or information about the structure based on data such as a feature map and a kernel for each layer of the artificial neural network model. The kernel may also be referred to as a weight. The feature map may also be referred to as node data. For example, ANN data locality may be generated when designing, completing training, or compiling an artificial neural network model. The NPU scheduler may store the ANN data locality information in the form of a register map. However, the present disclosure is not limited thereto.


The NPU scheduler can schedule the operation sequence of the artificial neural network model based on ANN data locality information.


The NPU scheduler may acquire a memory address value, in which the feature map and the kernel data of each layer of the artificial neural network model, are stored based on the ANN data locality information. For example, the NPU scheduler may obtain a memory address value in which the feature map and the kernel data of the layer of the artificial neural network model stored in the memory. Therefore, the NPU scheduler may prefetch at least a part of the feature map and kernel data of the layer of the artificial neural network model to be driven from the main memory, and then provide it to the NPU internal memory in a timely manner. The feature map of each layer may have a corresponding memory address value. Each kernel data may have a corresponding memory address value, respectively.


The NPU scheduler may schedule the operation sequence of the PE array based on the ANN data locality information, for example, data arrangement for layers of an artificial neural network of an artificial neural network model or information about a structure.


Since the NPU scheduler schedules the operations based on ANN data locality information, it may operate differently from the general CPU scheduling concept. Scheduling of a general CPU operates to achieve the best efficiency by considering fairness, efficiency, stability, and response time. That is, it is scheduled to perform the most processing within the same time in consideration of priority and operation time.


The conventional CPU used an algorithm for scheduling tasks in consideration of data such as the priority order of each processing, operation processing time, and the like.


That is, since the scheduling of a general CPU is random and difficult to predict, it is determined based on statistics, probability, and priority. On the contrary, since the artificial neural network operation is predictable rather than random, more efficient scheduling is possible. In particular, since artificial neural network computation has a huge amount of data, the computational processing speed of artificial neural network can be significantly improved according to efficient scheduling.


The NPU scheduler may determine the operation order based on the ANN data locality information.


Further, the NPU scheduler may determine the operation order based on the ANN data locality information and/or the data locality information of the NPU to be used or information about the structure.


According to the structure of the artificial neural network model, calculations for each layer are sequentially performed. That is, when the structure of the artificial neural network model is determined, the operation sequence for each layer may be determined. The sequence of operations or data flow according to the structure of the artificial neural network model can be defined as the data locality of the artificial neural network model at the algorithm level.


The PE array means a configuration in which a plurality of PEs, configured to calculate a feature map and a kernel of an artificial neural network, are arranged. Each PE may include a multiply and accumulate (MAC) operator and/or an Arithmetic Logic Unit (ALU) operator. However, examples according to the present disclosure are not limited thereto.


On the other hand, the internal memory in the NPU may be a static memory. For example, the internal memory may be a SRAM or a register. The internal memory may simultaneously perform a read operation and a write operation. To this end, the AMC and the NPU may be connected through a dual-port communication interface. Alternatively, when the AMC and the NPU are connected through a single-port communication interface, a read operation and a write operation may be sequentially performed in a time-division multiplexing (TDM) manner.


The AMC may include an ANN data locality information management unit and a buffer memory.


The AMC may monitor the operation sequence information of the NPU through the ANN data locality information management unit.


The ANN data locality information management unit may order and manage the data to be provided to the PEs according to the operation sequence of the NPU. The buffer memory may temporarily store data read from the main memory before providing the data to the NPU. Also, the buffer memory may temporarily store the output feature map provided from the NPU before transferring it to the main memory.


The AMC reads the data to be requested by the NPU based on the ANN data locality information from the main memory before the NPU requests it and stores it in the buffer memory. The AMC immediately provides the corresponding data stored in the buffer memory when the NPU actually requests the corresponding data. Therefore, as the AMC is provided, the RAS latency and CAS latency that may be generated by the main memory can be substantially removed by monitoring the operation sequence of the artificial neural network model processed by the NPU.


The main memory may be a dynamic memory. For example, the main memory may be a DRAM. The main memory, which is the DRAM, and the AMC may be connected through a system bus, for example, an AXI interface. The system bus may be implemented as a single-port. In this case, the DRAM may not be able to simultaneously process a read operation and a write operation.


Meanwhile, the AMC may rearrange data in the main memory so that a read operation becomes a burst operation based on the ANN data locality information.


Accordingly, when the DRAM, which is the main memory, supplies data to the buffer memory in a burst operation, the buffer memory may stream the data to the NPU.


The buffer memory may be implemented as a first input, first output (FIFO) form. The AMC switches to a standby state when the buffer memory is full. When the buffer memory transmits data to the NPU, the AMC reads data from the main memory based on the ANN data locality information and stores the data in the buffer memory. The AMC may exchange first data stored in a first memory address and second data stored in a second memory address.


If the size of the buffer memory is small (e.g., 1 KB), the buffer memory may only perform caching for hiding latency between the main memory and the NPU. In this case, a large amount of data may be transferred at once between the main memory and the NPU according to a burst operation. If the burst operation is performed sufficiently as such, the bandwidth of the main memory may be substantially maximized.


As a modified example of FIG. 17, the AMC may be embedded in the NPU, embedded in the main memory, or embedded in a system bus.



FIG. 18 shows an architecture of a system according to the second example.


Referring to FIG. 18, the NPU, the AMC and the main memory are shown. In the second example, duplicate descriptions described in other examples may be omitted for convenience of description. Configurations of other examples may be selectively applicable to this example.


The NPU may include an NPU scheduler, a plurality of internal memories, and a PE array.


Unlike FIG. 17, the plurality of internal memories in the NPU of FIG. 18 may include a first internal memory for a kernel, a second internal memory for an input feature map, and a third internal memory for an output feature map. The first to third internal memories may be a plurality of regions allocated in one physical memory. Each internal memory may each be provided with a port capable of communicating with the PE array. If each port is provided for each internal memory, the bandwidth of each internal memory may be guaranteed.


The size of each internal memory may be variably adjusted time to time. For example, the total of each internal memory is one MByte, and the size of each internal memory may be divided in a ratio of A:B:C. For example, the size of each of the internal memories may be divided in a ratio of 1:2:3. The ratio of each internal memory may be adjusted according to the size of the input feature map, the size of the output feature map, and the size of the kernel for each operation sequence of the artificial neural network model.


Unlike FIG. 17, the AMC of FIG. 18 may include a direct memory access (DMA) controller.


The external main memory may be a DRAM.


Even if the DMA controller does not receive a command from the NPU while the PE array of the NPU is performing an operation for inference, data may be independently read from the main memory and stored in the buffer memory based on the ANN data locality information.


The DMA controller reads the data to be requested by the NPU based on the ANN data locality information from the main memory before the request from the NPU, and stores it in the buffer memory. The DMA controller immediately provides the corresponding data stored in the buffer memory when the NPU actually requests the corresponding data. Accordingly, as the DMA controller is provided, it is possible to substantially eliminate a RAS latency and a CAS latency that may be caused by the main memory.



FIG. 19 shows an architecture of a system according to the third example.


Referring to FIG. 19, a NPU, an AMC, and a main memory is shown. In the third example, duplicate descriptions described in other examples may be omitted for convenience of description. Configurations of other examples may be selectively applicable to this example.


The NPU may include an NPU scheduler, a plurality of internal memories, and a PE array.


Unlike FIG. 17, the plurality of internal memories in the NPU of FIG. 19 may include a first internal memory for a kernel, a second internal memory for an input feature map, and a third internal memory for an output feature map. The first to third internal memories may be a plurality of regions allocated in one physical memory.


Unlike FIG. 17, the AMC of FIG. 19 may include an ANN data locality information management unit, a swap memory, and a buffer memory.


The external main memory may be a DRAM.


A swap memory in the AMC may be used to rearrange data in the main memory.


In the main memory, data may be fragmented and stored at random addresses. However, when data is randomly stored, a non-sequential memory address must be used to read data from the main memory. In this case, CAS latency and RAS latency may occur frequently.


To solve such problem, the AMC may rearrange the data in the main memory based on the ANN data locality information. Specifically, the AMC temporarily stores at least a portion of the fragmented data from the main memory to the swap memory. Subsequently, the data stored in the main memory may be rearranged to enable a burst operation based on the ANN data locality information.


The data rearrangement operation may be performed only once during the initial stage. However, the present disclosure is not limited thereto. If the ANN data locality information is changed, the reordering operation may be performed again based on the altered ANN data locality information.


Meanwhile, as a modification, the AMC may perform the data rearrangement by allocating a swap area in the main memory without using the swap memory.



FIG. 20 shows an architecture of a system according to the fourth example.


Referring to FIG. 20, a NPU, an AMC, and a main memory is shown. In the fourth example, duplicate descriptions described in other examples may be omitted for convenience of description. Configurations of other examples may be selectively applicable to this example.


The NPU may include an NPU scheduler, a plurality of internal memories, and a PE array.


Unlike FIG. 17, the plurality of internal memories in the NPU of FIG. 20 may include a first internal memory for a kernel, a second internal memory for an input feature map, and a third internal memory for an output feature map.


The AMC may include an ANN data locality information management unit and a plurality of buffer memories.


Unlike FIG. 17, the plurality of buffer memories shown in FIG. 20 may include a first buffer memory for a kernel, a second buffer memory for an input feature map, and a third buffer memory for an output feature map. The first to third buffer memories may be a plurality of regions allocated in one physical memory.


Each internal memory in the NPU may be connected to each buffer memory in the AMC. For example, the first internal memory may be directly connected to the first buffer memory, the second internal memory may be directly connected to the second buffer memory, and the third internal memory may be connected to the third buffer memory.


Each buffer memory may be provided with a port that can communicate with each internal memory of the NPU, respectively.


The size of each buffer memory may be variably adjusted. For example, the total of each buffer memory is 1 MByte, and the size of each buffer memory may be divided in a ratio of A:B:C. For example, the size of each buffer memory may be divided in a ratio of 1:2:3. The ratio of each buffer memory may be adjusted according to the size of the input feature map, the size of the output feature map, and the size of the kernel data for each operation order of the artificial neural network model.


The AMC may individually store data for the operation of the NPU in each of the buffer memories based on the ANN data locality information.


On the other hand, as can be seen with reference to FIG. 23, when the artificial neural network model is based on Mobilenet V1.0, the size deviation of the kernel (i.e., weight) for depth-wise convolution and/or point-wise convolution may be quite large.


Accordingly, the size of each internal memory may be adjusted based on the ANN data locality information. Similarly, the size of each buffer memory may be adjusted.



FIG. 21 shows an architecture of a system according to the fifth example.


Referring to FIG. 21, a NPU, an AMC, and a main memory is shown. In the fifth example, duplicate descriptions described in other examples may be omitted for convenience of description. Configurations of other examples are selectively applicable to this example.


The NPU may include an NPU scheduler, a plurality of internal memories, and a PE array.


Unlike FIG. 17, the plurality of internal memories in the NPU shown in FIG. 21 may include a first internal memory for a kernel, a second internal memory for an input feature map, and a third internal memory for an output feature map.


The AMC may include an ANN data locality information management unit and a buffer memory.


As mentioned in another examples, data may be randomly fragmented in the main memory. However, when data is randomly stored in this way, a non-sequential memory address must be used to read data from the main memory. As a result, CAS latency and RAS latency may occur.


To solve this problem, the AMC may rearrange the data in the main memory based on the ANN data locality information. Specifically, the AMC temporarily stores at least a portion of the fragmented data in the main memory in the buffer memory. Subsequently, the data stored in the main memory may be rearranged to enable a burst operation based on the ANN data locality information.


Meanwhile, when data is rearranged, a memory address may be changed.


Accordingly, the ANN data locality information management unit in the AMC and the NPU scheduler may communicate with each other. Specifically, the ANN data locality information management unit stores the updated memory address after the data rearrangement. Then, the ANN data locality information management unit may update the previous memory address stored in the NPU scheduler.



FIG. 22 shows an architecture of a system according to the sixth example.


Referring to FIG. 22, a NPU, an AMC, and a main memory is shown. In the sixth example, duplicate descriptions described in other examples may be omitted for convenience of description. Configurations of other examples are selectively applicable to this example.


The NPU may include an NPU scheduler, a plurality of internal memories, and a PE array.


Unlike FIG. 17, the plurality of internal memories in the NPU shown in FIG. 22 may include a first internal memory for weights, a second internal memory for input feature maps, and a third internal memory for output feature maps. The first to third internal memories may be a plurality of regions allocated in one physical memory


The AMC may include an ANN data locality information management unit, a translation lookaside buffer (TLB), and a buffer memory.


The data may be randomly stored in the main memory. However, when data is randomly stored as such, in order to read data from the main memory, a non-sequential memory address must be used, so there is a possibility that CAS latencies and RAS latencies may occur.


To solve this problem, the AMC may rearrange the data in the main memory based on the ANN data locality information. Specifically, after temporarily storing the data stored in the main memory into the buffer memory, the AMC may rearrange the data stored in the main memory to enable a burst operation based on the ANN data locality information.


Meanwhile, when data is rearranged, a memory address may be changed. Accordingly, the TLB in the AMC may store the old memory address before the rearrangement and the new memory address after the rearrangement in the form of a table.


When the scheduler in the NPU requests data using the old memory address, the TLB in the AMC may convert the old memory address to the new memory address, read data from the main memory, and store the data in the buffer memory.


Accordingly, unlike FIG. 21, the main memory can operate in the burst mode without updating the memory address stored in the NPU scheduler through the TLB.


In the various examples described above, the AMC and the NPU are shown in a separate configuration, but the AMC may be configured to be included in the NPU.



FIG. 23 is an exemplary diagram illustrating an example of data when Mobilenet V1.0 is used as an artificial neural network model.


Referring to FIG. 23, the structure and algorithm of the artificial neural network model are defined. According to various examples of the present disclosure, a compiler, an AMC or a NPU scheduler may be configured to monitor, update, generate and/or store the ANN data locality information of the artificial neural network model.


Mobilenet V1.0 may consist of, for example, 28 layers. The input feature map, the kernel, and the output feature map of each layer have their own sizes, and activation functions applied to each layer are defined.


As can be seen with reference to FIG. 23, when Mobilenet V1.0 is used as an artificial neural network model, the deviation between the data size of the kernel, the data size of the input feature map (IFMAP), and the data size of the output feature map (OFMAP) can be quite large for each layer.



FIG. 24 shows an example of performing an operation after caching data from the main memory to the buffer memory.


As can be seen with reference to FIG. 24, a memory map of a main memory to which DRAM is applied and a memory map of a buffer memory in the AMC are shown. The main memory and the buffer memory may be connected to each other through a system bus (e.g., an AXI interface). The buffer memory may be referred to as a cache memory.


The memory map of the main memory may be set so that the main memory operates in a burst mode based on artificial neural network data locality information.


The burst mode can be the read-burst or the write-burst.


The memory map of the buffer memory may sequentially cache data corresponding to the data to be sequentially requested by the NPU based on the artificial neural network data locality information.


The memory map of the main memory and the memory map of the buffer memory in the AMC correspond to each other based on the artificial neural network data locality information.


A first kernel Kernel_1, a first input feature map IFMAP_1, and a first output feature map OFMAP_1 may be allocated to the memory map of the main memory.


The first kernel Kernel_1 may be a kernel of the first layer Conv1 of the artificial neural network of FIG. 23. The first input feature map IFMAP_1 may be an input feature map of the first layer Conv1 of the artificial neural network of FIG. 23. The first output feature map OFMAP_1 may be an output feature map of the first layer Conv1 of the artificial neural network of FIG. 23.


A second kernel Kernel_2 and a second output feature map OFMAP_2 may be allocated to the memory map of the main memory. In this case, the first output feature map OFMAP_1 may be assigned to the memory map as a second input feature map IFMAP_2. That is, the output feature map of a specific layer of the artificial neural network may be the input feature map of the next layer.


The second kernel Kernel_2 may be a kernel of the second layer Conv2 of the artificial neural network of FIG. 23. The second input feature map IFMAP_2 may be an input feature map of the second layer Conv2 of the artificial neural network of FIG. 23. The second output feature map OFMAP_2 may be an output feature map of the second layer Conv2 of the artificial neural network of FIG. 23.


As described above, the second output feature map OFMAP_2 may be allocated to the memory map as the third input feature map IFMAP 3. Also, as illustrated, the main memory may allocate a plurality of kernels and a plurality of output feature maps to the memory map. Each output feature map may be used as the next input feature map. Accordingly, the memory map set based on the artificial neural network data locality information may allow the main memory to be optimized for the burst mode.


The buffer memory in the AMC may cache kernels and output feature maps stored in the main memory in advance based on the ANN data locality information and the size of the buffer memory. If the size of the buffer memory is insufficient, data to be cached may be tiled. For example, tiling may be determined in advance or in real time based on the ANN data locality information by a compiler or an AMC.


The NPU scheduler of the NPU reads the input feature map and the kernel from the buffer memory and stores them in the internal memory of the NPU.


The PE array of the NPU reads the input feature map and the kernel from the internal memory and performs a convolutional operation.


For the convolution operation in the PE array, both the kernel and at least a part of the input feature map need be prepared in the internal memory.


Hereinafter, in FIG. 24, the convolution of the kernel of the first layer Conv1, the input feature map, and the output feature map of FIG. 23 will be described as an example. For convenience of description below, the sizes of the kernel and the input feature map will be arbitrarily described.


Hereinafter, a case in which the size of the first kernel Kernel_1 is 3×3×1 and the size of the first input feature map IFMAP_1 is 9×9×1 will be described as an example.


A memory map of the main memory may be set to read a first kernel Kernel_1, which is relatively smaller in size than the first input feature map IFMAP_1, from the main memory before the first input feature map IFMAP_1.


If the address of the above-described memory map is sequentially read, the first kernel Kernel_1 sequentially allocated to the memory map is first read, and then the first input feature map IFMAP_1 is read. Therefore, the main memory can be enabled for burst mode operation.


On the other hand, if the kernel and the input feature map are not read from the main memory to the internal memory, the NPU cannot start the convolution operation.


However, when a small-sized kernel is first read, and the data of the input feature map is read from the main memory in the direction of the arrow shown in FIG. 24, even if at least part of the input feature map is read, the convolution operation can be started. In FIG. 24, when data of nine cells of input feature map overlapping the kernel are prepared, the start of the convolution operation is possible. Accordingly, the NPU may be configured to first read the kernel from the internal memory.


For example, as shown, it is assumed that the first input feature map IFMAP_1 for the first layer has a size of 9×9x1, and the first kernel Kernel_1 has a size of 3×3×1. First, the NPU reads the first kernel Kernel_1 from the internal memory. Next, as shown, the convolution operation may be started while reading at least a part of the first input feature map IFMAP_1 overlapping the start position of the kernel.


Next, the NPU performs convolution of the first input feature map IFMAP_1 starting from the first row of the fourth column to the second row of the fourth column. The sequence is shown by the first arrow AR1.


Next, the NPU performs convolution of the first input feature map IFMAP_1 starting from the fourth row of the first column to the fourth row of the first column. The sequence is shown by the first arrow AR2.


According to the above-described operation, the first output feature map OFMAP_1 is generated. The order in which the first output feature map OFMAP_1 is generated is shown by the third arrow AR3.


The first output feature map OFMAP_1 according to the convolution operation may have a size of 7×7×1 as shown.


That is, the order of reading the input feature map from the main memory may correspond to the direction of the arrow in FIG. 24. Therefore, the memory map of the input feature map stored in the main memory may be set to have an address value in consideration of the movement direction of the kernel for the burst mode operation.


In FIG. 24, the buffer memory is implemented in the form of a FIFO memory.


In FIG. 24, two memory maps according to time elapse are shown in the buffer memory. The memory map at the upper side is the initial memory map, and the memory map below the arrow is the memory map after a certain time has elapsed.


Referring to the upper memory map of the buffer memory, the buffer memory is continuously filled in such a way that a first kernel Kernel_1 is input and then a first input feature map IFMAP_1 is input.


Referring to the lower memory map of the buffer memory, the memory map may be updated for each specific operation. That is, the buffer memory may be continuously filled in such a way that the third output feature map OFMAP_3 is input and then the fourth kernel Kernel_4 is input.



FIG. 25 shows another example of caching data from the main memory to the cache memory and then performing an operation according to a tiling technique.


Referring to FIG. 25, the main memory and the buffer memory (cache memory) in the AMC are shown. The main memory and the buffer memory may be connected to each other through a system bus. The example of FIG. 25 is an example in which the tiling technique is applied to the example of FIG. 24. Hereinafter, an example of tiling will be described. The example of FIG. 24 shows a case in which the input feature map is tiled.


At least one of a kernel, an input feature map, and an output feature map stored in the main memory may be tiled. The memory map of the main memory may be tiled.


At least one of a kernel, an input feature map, and an output feature map stored in the buffer memory may be tiled. The memory map of the buffer memory may be tiled.


As shown, it is assumed that the input feature map for the first layer Conv1 has a size of 18×18×1 for convenience of description. The input feature map may be tiled into four input feature maps having a size of 9×9×1.


That is, the first input feature map for the first layer Conv_1 includes a first input feature map tile IFMAP_1-1, a second input feature map tile IFMAP_1-2, a third input feature map tile IFMAP_1-3, and a fourth input feature map tile IFMAP_1-4. The four input feature map tiles may be combined to form a first input feature map.


In this case, the first kernel Kernel_1 of the first layer Conv1 may be reused. Therefore, the same kernel can be used for the convolution of each tile. In this case, the first kernel Kernel_1 may be reused in the NPU internal memory until the four tiling is completed.


That is, a first output feature map tile OFMAP_1-1 is generated by convolution of the first kernel Kernel_1 and the first input feature map tile IFMAP_1-1. A second output feature map tile OFMAP_1-2 is generated by convolution of the first kernel Kernel_1 and the second input feature map tile IFMAP_1-2. A third output feature map tile OFMAP_1-3 is generated by convolution of the first kernel Kernel_1 and the third input feature map tile IFMAP_1-3. A fourth output feature map tile OFMAP_1-4 is generated by convolution of the first kernel Kernel_1 and the fourth input feature map tile IFMAP_1-4. The four output feature map tiles may be combined to form a first output feature map.


In this case, the memory map of the main memory may be set to be operable in a burst mode based on the tiled artificial neural network data locality information. That is, the artificial neural network data locality information may be changed according to the tiling method. The tiling rule may be variously modified.


That is, the ANN data locality information includes the sequence of data requested by the NPU to the main memory, and also includes the sequence according to the tiling.


For example, the ANN data locality information may include the order of a first input feature map tile IFMAP_1-1, a second input feature map tile IFMAP_1-2, a third input feature map tile IFMAP_1-3, and a fourth input feature map tile IFMAP_1-4.


For example, the ANN data locality information may include the order of a fourth input feature map tile IFMAP_1-4, a third input feature map tile IFMAP_1-3, a second input feature map tile IFMAP_1-2, and a first input feature map tile IFMAP_1-1.


That is, the buffer memory of the AMC may receive or generate the ANN data locality information to predict a sequence of requests from the NPU, and sequentially cache data corresponding to the sequence.



FIG. 26 shows an example of rearranging data in the main memory.


The example of FIG. 26 is an example for explaining a method of resetting the memory map of the main memory according to the locality of the ANN data.


Referring to FIG. 26, the main memory may store at least one weight, at least one input feature map, and at least one output feature map.


As described above in FIG. 25, when tiling is applied, the ANN data locality may be reset. For example, the processing sequence of each tiled tile may be changed. In this case, in order for the main memory to operate in the burst mode, the memory map of the main memory may be reset according to the locality of the ANN data.


As described with reference to FIG. 25, the input feature map of the first layer may be divided into four input feature map tiles. That is, the input feature map of the first layer can be divided into first input feature map tile IFMAP_1-1, second input feature map tile IFMAP_1-2, third input feature map tile IFMAP_1-3, and fourth input feature map tile IFMAP_1-4.


As described with reference to FIG. 25, the output feature map of the first layer may be divided into four output feature map tiles. That is, the output feature map of the first layer can be divided into first output feature map tile OFMAP_1-1, second output feature map tile OFMAP_1-2, third output feature map tile OFMAP_1-3, and fourth output feature map tile OFMAP_1-4.


In this case, if the preset memory map of the main memory does not correspond to the ANN data locality information with respect to the read-burst operation, unnecessary RAS latencies and CAS latencies may occur in the main memory, and the burst mode operation efficiency may be significantly reduced. In addition, unnecessary power consumption may be increased.


In this case, the memory map of the main memory may be reordered based on the ANN data locality information in the AMC. In this case, the AMC may be configured to directly control the main memory to reset a memory map capable of burst mode operation.



FIG. 27 is an exemplary view showing an address system of the main memory for the operation of the NPU.


Referring to FIG. 27, the memory map of the main memory may include a kernel, an input feature map, and an output feature map.


The memory map of the main memory may be configured to have an address optimized for burst mode operation based on the locality of the ANN data of the artificial neural network model processed by the NPU.


Referring to the memory map shown in FIG. 27, the data size of the first kernel Kernel_1 of the first layer Conv1 may be 864 bytes, the start address may be 0x00000000000, and the end address may be 0x00000000099. The data size of the first input feature map IFMAP_1 may be 150,528 bytes, the start address may be 0x00000000100, and the end address may be 0x00000000199. The data size of the second kernel Kernel_2 of the second layer Conv1 may be 401,408 bytes, the start address may be 0x00000000200, and the end address may be 0x00000000299. However, the data size and address of FIG. 27 are just arbitrary numbers and have no special meaning. Said address means an address of the main memory.


A memory map based on ANN data locality may be set in such a way that the address of the main memory increases or decreases.


To elaborate, the meaning of following the ANN data locality may mean that following the sequence of memory operations that the NPU will request to main memory.


That is, according to the ANN data locality, it can be seen that the NPU requests the first kernel Kernel_1 first, and then requests the first input feature map IFMAP_1. Therefore, in order to operate the first kernel Kernel_1 and the first input feature map IFMAP_1 in read-burst mode, the memory map of the main memory must be set to correspond to the locality of the ANN data.


Referring to FIG. 27, the memory map may be configured to enable the main memory to supply data to the AMC in burst mode based on the sequence of all memory read and write operations (i.e., ANN data locality) of the artificial neural network model that the NPU requests to the main memory.


Accordingly, it is possible to maximize the effective bandwidth of the system bus between the main memory and the AMC. In addition, unnecessary latency can be removed to reduce power consumption. Also, since the buffer memory of the AMC can cache the data to be requested by the NPU before the request is made by the NPU, cache misses can be substantially eliminated.


Also, it can be seen that the first output feature map OFMAP_1 and the second input feature map IFMAP_2 may have the same address. Setting the same address of the output feature map of a specific layer and the input feature map of the next layer may be set based on the locality of the ANN data. Accordingly, it is possible to reduce the memory usage of the main memory.



FIG. 28 shows an example in which the AMC controls the burst operation of the main memory based on the ANN data locality.


When describing FIG. 28, reference may be made to FIGS. 4 and 23 together. FIG. 28 shows the name of each layer of the artificial neural network model, the corresponding burst operation command for the main memory, the corresponding memory map, the corresponding ANN data locality information (ANN DL), and the data size.


For example, the first layer Conv1 may include a first kernel Kernel_1, a first input feature map IFMAP_1, and a first output feature map OFMAP_1.


The first kernel Kernel_1 may include a memory map address corresponding to the first kernel Kernel_1 illustrated in FIG. 27. The first input feature map IFMAP_1 may include a memory map address corresponding to the first input feature map IFMAP_1 shown in FIG. 27. The first output feature map OFMAP_1 may include a memory map address corresponding to the first output feature map OFMAP_1 shown in FIG. 27.


As described above in other examples, the ANN data locality information ANN DL may include a data access request sequence in which the NPU commands the main memory. In addition, the data access request sequence may correspond to the token described in FIG. 4.


The ANN data locality information ANN DL may be stored in the NPU scheduler of the NPU and/or the ANN data locality information management unit of the AMC in other examples.


The AMC may be configured to instruct each data access request to the main memory in a burst mode when the system bus communicating with the main memory is configured as a bus supporting the burst mode. For example, one of the DRAM buses, Advanced eXtensible Interface 4 (AXI4), supports burst mode.


As described above, since the artificial neural network model stored in the main memory has a memory map generated in consideration of the consecutive burst mode, the system bus may have effects of increasing effective bandwidth and reducing power consumption.



FIG. 29 is an exemplary diagram illustrating an example of a method of mapping an address of a main memory based on the ANN data locality information.


Referring to FIG. 29, the basic structure of DRAM is shown. A DRAM includes a plurality of memory cells in a matrix structure having addresses of rows and columns. A sense amplifier is disposed at lower ends of the plurality of memory cells of the matrix structure. The row address decoder selects a specific row. RAS latency is required to perform the corresponding operation. Data of the memory cells of the selected row are latched in the sense amplifier. The column address decoder selects necessary data from the data latched in the sense amplifier and transmits it to the data buffer. CAS Latency is required to perform the corresponding operation. The structure may be referred to as a bank of DRAM. A DRAM may include a plurality of banks.


At this time, when the DRAM operates in the burst mode, data is read or written while the addresses of the memory cells are sequentially increased. Therefore, compared to the case of reading fragmented address data, RAS latency and CAS latency are minimized.


To elaborate, even if the AMC or NPU command the burst mode to the main memory, if the data stored in the DRAM is actually fragmented, RAS latency and CAS latency are generated due to the fragmentation. Therefore, it is difficult to actually reduce RAS latency and CAS latency by simply executing the burst mode command.


On the contrary, in the case of SRAM, whether data is fragmented does not substantially cause latency. Therefore, in the buffer memory or internal memory composed of SRAM, latency generation due to data fragmentation may not be fatal


Referring to FIG. 29, the memory map may be set in consideration of the sequence and size of data requested by the NPU to the memory cells of the DRAM based on the ANN data locality information ANN DL. The memory map may be set based on a start address and an end address based on each data size. Accordingly, if memory operations are performed in the order of the ANN data locality information ANN DL in the DRAM, all memory operations may be operated in the burst mode.


Accordingly, the main memory shown in FIG. 29 may be controlled based on the memory address and operation mode shown in Table 2.


The ANN data locality information ANN DL corresponding to FIG. 29 and Table 2 is an example of a case in which the NPU is set to request data from the main memory in the order of the input feature map, the kernel, and the output feature map.















TABLE 2








Operation

ANN
Size


Layer
Start address
End address
Mode
Domain
DL
(Bytes)





















1
0
A = A′
Read-Burst
IFMAP
1
A


1
A′ + 1
A + 1 + B = B′
Read-Burst
Kernel
2
B


1
B′ + 1
B′ + 1 + C = C′
Write-Burst
OFMAP
3
C


2
B′ + 1
B′ + 1 + C = C′
Read-Burst
IFMAP
4
C


2
C′ + 1
C′ + 1 + D = D′
Read-Burst
Kernel
5
D


2
D′ + 1
D′ + 1 + E = E′
Write-Burst
OFMAP
6
E


3
D′ + 1
D′ + 1 + E = E′
Read-Burst
IFMAP
7
E


3
E′ + 1
E′ + 1 + F = F′
Read-Burst
Kernel
8
F


3
F′ + 1
F′ + 1 + G = G′
Write-Burst
OFMAP
9
G


4
F′ + 1
F′ + 1 + G = G′
Read-Burst
IFMAP
10
G


4
G′ + 1
G′ + 1 + H = H′
Read-Burst
Kernel
11
H


4
H′ + 1
H′ + 1 + I = I′
Write-Burst
OFMAP
12
I


5
H′ + 1
H′ + 1 + I = I′
Read-Burst
IFMAP
13
I


5
I′ + 1
I′ + 1 + J = J′
Read-Burst
Kernel
14
J


5
J′ + 1
J′ + 1 + K = K′
Write-Burst
OFMAP
15
K









To elaborate, it is also possible to utilize the domain information described with reference to FIG. 12 for the domain of Table 2. In addition, it is also possible to utilize the operation mode information described in FIG. 12 for the operation mode of Table 2.


Since the data is mapped to sequential addresses according to the ANN data locality information ANN DL, the data can be processed with a burst mode command.


That is, the AMC can cache the necessary data before the NPU makes a request based on the ANN data locality information ANN DL, and can determine the sequence of all requests. Therefore, the cache hit probability of the buffer memory of the AMC can theoretically be 100%.


Also, since the memory map of the main memory is set based on the ANN data locality information ANN DL, it is also possible for all memory operations to operate in the burst mode.


Although a single memory bank is exemplarily shown in FIG. 29, address mapping may be performed by a bank interleaving method according to the configuration of a bank, a rank, and a channel of the memory.


If there is no ANN data locality information ANN DL, it is practically unable to sequentially store data requested by the NPU in the DRAM. That is, even if there is artificial neural network model information shown in FIG. 23, if no ANN data locality information ANN DL described in various examples is provided, it is impossible to know all the sequences of data operations that the NPU requests to the main memory.


If the AMC does not have the ANN data locality information ANN DL, it is difficult to know whether the NPU will first request the kernel or the input feature map of the first layer of the artificial neural network model at the AMC. Accordingly, it is substantially difficult to set a memory map considering the burst mode in the main memory.



FIG. 30 is an exemplary diagram illustrating another example of a method of mapping an address of a main memory based on the ANN data locality information.


Since the structure of the main memory shown in FIG. 30 is substantially the same as that of the main memory shown in FIG. 29, redundant description may be omitted.


Referring to FIG. 30, a memory map may be set in consideration of the sequence and size of data requested by the NPU to the memory cells of the DRAM based on the ANN data locality information ANN DL. The memory map may be set based on a start address and an end address based on each data size. Accordingly, if memory operations are performed in the sequence of the ANN data locality information ANN DL in the DRAM, all memory operations may be operated in the burst mode.


Accordingly, the main memory shown in FIG. 30 may be controlled based on the memory address and operation mode shown in Table 3.


The ANN data locality information ANN DL corresponding to FIG. 30 and Table 3 is an example of a case in which the NPU is set to use the input feature map and the output feature map in common.















TABLE 3








Operation

ANN
Size


Layer
Start ddress
End address
Mode
Domain
DL
(Bytes)





















1
0
M_FMAP = A′
Read-Burst
IFMAP
1
M_FMAP


1
A′ + 1
A′ + 1 + B = B′
Read-Burst
Kernel
2
B


1
0
C
Write-Burst
OFMAP
3
C


2
0
C
Read-Burst
IFMAP
4
C


2
B′ + 1
B′ + 1 + D = D′
Read-Burst
Kernel
5
D


2
0
E
Write-Burst
OFMAP
6
E


3
0
E
Read-Burst
IFMAP
7
E


3
D′ + 1
D′ + 1 + F = F′
Read-Burst
Kernel
8
F


3
0
G
Write-Burst
OFMAP
9
G


4
0
G
Read-Burst
IFMAP
10
G


4
F′ + 1
F′ + 1 + H = H′
Read-Burst
Kernel
11
H


4
0
I
Write-Burst
OFMAP
12
I


5
0
I
Read-Burst
IFMAP
13
I


5
H′ + 1
H′ + 1 + J = J′
Read-Burst
Kernel
14
J


5
0
K
Write-Burst
OFMAP
15
K









The value of the kernel is fixed when the training of the artificial neural network model is completed. Therefore, the value of the kernel has a constant characteristic. On the other hand, since the input feature map and the output feature map may be an input such as an image data, a camera, a microphone, a radar, a lidar, and the like, and once used, they may not be reused any more.


Referring to FIG. 23 as an example, the sizes of the input feature map and the output feature map of the artificial neural network model are defined. Therefore, it is possible to select the largest data size M_FMAP among the input feature map and the output feature map of the artificial neural network model. In the case of the artificial neural network model of FIG. 23, the feature map M_FMAP of the maximum size is 802,816 bytes. Therefore, the input feature maps and output feature maps of each layer of the artificial neural network model in Table 3 are set to have the same start address. That is, the input feature map and the output feature map may overwrite the same memory address area. As described above, due to the characteristics of the artificial neural network model, an output feature map is generated by performing a convolution operation on the input feature map and the kernel, and the corresponding output feature map may become the input feature map of the next layer. Therefore, the feature map of the previous layer is not reused and may be discarded.


According to the above-described configuration, the size of the memory map of the main memory can be reduced by setting the memory area set based on the maximum feature map size as the shared area of the input feature map and the output feature map.


An example of the present disclosure will be described with reference to Table 4 below.


Table 4 shows an example in which the kernel, the input feature map, and the output feature map are stored in the main memory using a memory map of a specific address according to the memory operation sequence requested by the NPU based on the artificial neural network data locality information ANN DL.


Table 4 is an example using substantially the same method as the examples of Table 2 and FIG. 29, and is an example of setting a memory map according to the artificial neural network data locality information of the artificial neural network model shown in FIG. 23.


According to the table below, after the input feature map is first read from the main memory, then the kernel is read and convolution is performed, and then the output feature map is stored in the main memory. The data request sequence of the NPU may be determined based on the ANN data locality information ANN DL. Based on the ANN data locality information ANN DL, the AMC sequentially arrange the data requested by the NPU in the DRAM. Accordingly, the NPU can effectively perform burst read and write operations.


The memory map of the artificial neural network model defined in Table 4 may generate an inference result of the artificial neural network model when the memory operations of ANN data locality information ANN DL 1 to 84 are completed.















TABLE 4








Operation

ANN
Size


Layer
Start address
End address
mode
Domain
DL
(Bytes)





















1
0x000000
0x024C00
Read-Burst
IFMAP
1
150,528


1
0x024C01
0x024F60
Read-Burst
Kernel
2
864


1
0x024F61
0x086F60
Write-Burst
OFMAP
3
401,408


2
0x024F61
0x086F60
Read-Burst
IFMAP
4
401,408


2
0x086F61
0x087080
Read-Burst
Kernel
5
288


2
0x087081
0x0E9080
Write-Burst
OFMAP
6
401,408


3
0x087081
0x0E9080
Read-Burst
IFMAP
7
401,408


3
0x0E9081
0x0E9880
Read-Burst
Kernel
8
2,048


3
0x0E9881
0x1AD880
Write-Burst
OFMAP
9
802,816


4
0x0E9881
0x1AD880
Read-Burst
IFMAP
10
802,816


4
0x1AD881
0x1ADAC0
Read-Burst
Kernel
11
576


4
0x1ADAC1
0x1DEAC0
Write-Burst
OFMAP
12
200,704


5
0x1ADAC1
0x1DEAC0
Read-Burst
IFMAP
13
200,704


5
0x1DEAC1
0x1E0AC0
Read-Burst
Kernel
14
8,192


5
0x1E0AC1
0x242AC0
Write-Burst
OFMAP
15
401,408


6
0x1E0AC1
0x242AC0
Read-Burst
IFMAP
16
401,408


6
0x242AC1
0x242F40
Read-Burst
Kernel
17
1,152


6
0x242F41
0x2A4F40
Write-Burst
OFMAP
18
401,408


7
0x242F41
0x2A4F40
Read-Burst
IFMAP
19
401,408


7
0x2A4F41
0x2A8F40
Read-Burst
Kernel
20
16,384


7
0x2A8F41
0x30AF40
Write-Burst
OFMAP
21
401,408


8
0x2A8F41
0x30AF40
Read-Burst
IFMAP
22
401,408


8
0x30AF41
0x30B3C0
Read-Burst
Kernel
23
1,152


8
0x30B3C1
0x323BC0
Write-Burst
OFMAP
24
100,352


9
0x30B3C1
0x323BC0
Read-Burst
IFMAP
25
100,352


9
0x323BC1
0x32BBC0
Read-Burst
Kernel
26
32,768


9
0x32BBC1
0x35CBC0
Write-Burst
OFMAP
27
200,704


10
0x32BBC1
0x35CBC0
Read-Burst
IFMAP
28
200,704


10
0x35CBC1
0x35D4C0
Read-Burst
Kernel
29
2,304


10
0x35D4C1
0x38E4C0
Write-Burst
OFMAP
30
200,704


11
0x35D4C1
0x38E4C0
Read-Burst
IFMAP
31
200,704


11
0x38E4C1
0x39E4C0
Read-Burst
Kernel
32
65,536


11
0x39E4C1
0x3CF4C0
Write-Burst
OFMAP
33
200,704


12
0x39E4C1
0x3CF4C0
Read-Burst
IFMAP
34
200,704


12
0x3CF4C1
0x3CFDC0
Read-Burst
Kernel
35
2,304


12
0x3CFDC1
0x3DC1C0
Write-Burst
OFMAP
36
50,176


13
0x3CFDC1
0x3DC1C0
Read-Burst
IFMAP
37
50,176


13
0x3DC1C1
0x3FC1C0
Read-Burst
Kernel
38
131,072


13
0x3FC1C1
0x4149C0
Write-Burst
OFMAP
39
100,352


14
0x3FC1C1
0x4149C0
Read-Burst
IFMAP
40
100,352


14
0x4149C1
0x415BC0
Read-Burst
Kernel
41
4,608


14
0x415BC1
0x42E3C0
Write-Burst
OFMAP
42
100,352


15
0x415BC1
0x42E3C0
Read-Burst
IFMAP
43
100,352


15
0x42E3C1
0x46E3C0
Read-Burst
Kernel
44
262,144


15
0x46E3C1
0x486BC0
Write-Burst
OFMAP
45
100,352


16
0x46E3C1
0x486BC0
Read-Burst
IFMAP
46
100,352


16
0x486BC1
0x487DC0
Read-Burst
Kernel
47
4,608


16
0x487DC1
0x4A05C0
Write-Burst
OFMAP
48
100,352


17
0x487DC1
0x4A05C0
Read-Burst
IFMAP
49
100,352


17
0x4A05C1
0x4E05C0
Read-Burst
Kernel
50
262,144


17
0x4E05C1
0x4F8DC0
Write-Burst
OFMAP
51
100,352


18
0x4E05C1
0x4F8DC0
Read-Burst
IFMAP
52
100,352


18
0x4F8DC1
0x4F9FC0
Read-Burst
Kernel
53
4,608


18
0x4F9FC1
0x5127C0
Write-Burst
OFMAP
54
100,352


19
0x4F9FC1
0x5127C0
Read-Burst
IFMAP
55
100,352


19
0x5127C1
0x5527C0
Read-Burst
Kernel
56
262,144


19
0x5527C1
0x56AFC0
Write-Burst
OFMAP
57
100,352


20
0x5527C1
0x56AFC0
Read-Burst
IFMAP
58
100,352


20
0x56AFC1
0x56C1C0
Read-Burst
Kernel
59
4,608


20
0x56C1C1
0x5849C0
Write-Burst
OFMAP
60
100,352


21
0x56C1C1
0x5849C0
Read-Burst
IFMAP
61
100,352


21
0x5849C1
0x5C49C0
Read-Burst
Kernel
62
262,144


21
0x5C49C1
0x5DD1C0
Write-Burst
OFMAP
63
100,352


22
0x5C49C1
0x5DD1C0
Read-Burst
IFMAP
64
100,352


22
0x5DD1C1
0x5DE3C0
Read-Burst
Kernel
65
4,608


22
0x5DE3C1
0x5F6BC0
Write-Burst
OFMAP
66
100,352


23
0x5DE3C1
0x5F6BC0
Read-Burst
IFMAP
67
100,352


23
0x5F6BC1
0x636BC0
Read-Burst
Kernel
68
262,144


23
0x636BC1
0x64F3C0
Write-Burst
OFMAP
69
100,352


24
0x636BC1
0x64F3C0
Read-Burst
IFMAP
70
100,352


24
0x64F3C1
0x6505C0
Read-Burst
Kernel
71
4,608


24
0x6505C1
0x6567C0
Write-Burst
OFMAP
72
25,088


25
0x6505C1
0x6567C0
Read-Burst
IFMAP
73
25,088


25
0x6567C1
0x6D67C0
Read-Burst
Kernel
74
524,288


25
0x6D67C1
0x6E2BC0
Write-Burst
OFMAP
75
50,176


26
0x6D67C1
0x6E2BC0
Read-Burst
IFMAP
76
50,176


26
0x6E2BC1
0x6E4FC0
Read-Burst
Kernel
77
9,216


26
0x6E4FC1
0x6F13C0
Write-Burst
OFMAP
78
50,176


27
0x6E4FC1
0x6F13C0
Read-Burst
IFMAP
79
50,176


27
0x6F13C1
0x7F13C0
Read-Burst
Kernel
80
1,048,576


27
0x7F13C1
0x7F17C0
Write-Burst
OFMAP
81
1,024


28
0x7F13C1
0x7F17C0
Read-Burst
IFMAP
82
1,024


28
0x7F17C1
0x8EB7C0
Read-Burst
Kernel
83
1,024,000


28
0x8EB7C1
0x8EBBA8
Write-Burst
OFMAP
84
1,000









An example of the present disclosure will be described with reference to Table 5 below.


Table 5 shows an example in which a kernel, an input feature map, and an output feature map are stored in the main memory using a memory map of a specific address according to the memory operation sequence requested by the NPU based on the ANN data locality information ANN DL.


According to Table 5 below, after the kernel is first read from the main memory, then the input feature map is read and convolution is performed, and then the output feature map is stored in the main memory. The data request sequence of the NPU may be determined based on the ANN data locality information ANN DL. The AMC may analyze the ANN data locality information ANN DL, and sequentially arrange the data requested by the NPU. Therefore, the NPU can effectively perform burst read and write operations.


The artificial neural network model of the memory map defined in Table 5 may generate an inference result of the artificial neural network model when the memory operations of ANN data locality information (ANN DL) 1 to 84 are completed.















TABLE 5








Operation

ANN
Size


Layer
Start address
End address
Mode
Domain
DL
(Bytes)





















1
0x000000
0x000360
Read-Burst
Kernel
1
864


1
0x000361
0x024F60
Read-Burst
IFMAP
2
150,528


1
0x024F61
0x086F60
Write-Burst
OFMAP
3
401,408


2
0x086F61
0x087080
Read-Burst
Kernel
4
288


2
0x024F61
0x086F60
Read-Burst
IFMAP
5
401,408


2
0x087081
0x0E9080
Write-Burst
OFMAP
6
401,408


3
0x0E9081
0x0E9880
Read-Burst
Kernel
7
2,048


3
0x087081
0x0E9080
Read-Burst
IFMAP
8
401,408


3
0x0E9881
0x1AD880
Write-Burst
OFMAP
9
802,816


4
0x1AD881
0x1ADAC0
Read-Burst
Kernel
10
576


4
0x0E9881
0x1AD880
Read-Burst
IFMAP
11
802,816


4
0x1ADAC1
0x1DEAC0
Write-Burst
OFMAP
12
200,704


5
0x1DEAC1
0x1E0AC0
Read-Burst
Kernel
13
8,192


5
0x1ADAC1
0x1DEAC0
Read-Burst
IFMAP
14
200,704


5
0x1E0AC1
0x242AC0
Write-Burst
OFMAP
15
401,408


6
0x242AC1
0x242F40
Read-Burst
Kernel
16
1,152


6
0x1E0AC1
0x242AC0
Read-Burst
IFMAP
17
401,408


6
0x242F41
0x2A4F40
Write-Burst
OFMAP
18
401,408


7
0x2A4F41
0x2A8F40
Read-Burst
Kernel
19
16,384


7
0x242F41
0x2A4F40
Read-Burst
IFMAP
20
401,408


7
0x2A8F41
0x30AF40
Write-Burst
OFMAP
21
401,408


8
0x30AF41
0x30B3C0
Read-Burst
Kernel
22
1,152


8
0x2A8F41
0x30AF40
Read-Burst
IFMAP
23
401,408


8
0x30B3C1
0x323BC0
Write-Burst
OFMAP
24
100,352


9
0x323BC1
0x32BBC0
Read-Burst
Kernel
25
32,768


9
0x30B3C1
0x323BC0
Read-Burst
IFMAP
26
100,352


9
0x32BBC1
0x35CBC0
Write-Burst
OFMAP
27
200,704


10
0x35CBC1
0x35D4C0
Read-Burst
Kernel
28
2,304


10
0x32BBC1
0x35CBC0
Read-Burst
IFMAP
29
200,704


10
0x35D4C1
0x38E4C0
Write-Burst
OFMAP
30
200,704


11
0x38E4C1
0x39E4C0
Read-Burst
Kernel
31
65,536


11
0x35D4C1
0x38E4C0
Read-Burst
IFMAP
32
200,704


11
0x39E4C1
0x3CF4C0
Write-Burst
OFMAP
33
200,704


12
0x3CF4C1
0x3CFDC0
Read-Burst
Kernel
34
2,304


12
0x39E4C1
0x3CF4C0
Read-Burst
IFMAP
35
200,704


12
0x3CFDC1
0x3DC1C0
Write-Burst
OFMAP
36
50,176


13
0x3DC1C1
0x3FC1C0
Read-Burst
Kernel
37
131,072


13
0x3CFDC1
0x3DC1C0
Read-Burst
IFMAP
38
50,176


13
0x3FC1C1
0x4149C0
Write-Burst
OFMAP
39
100,352


14
0x4149C1
0x415BC0
Read-Burst
Kernel
40
4,608


14
0x3FC1C1
0x4149C0
Read-Burst
IFMAP
41
100,352


14
0x415BC1
0x42E3C0
Write-Burst
OFMAP
42
100,352


15
0x42E3C1
0x46E3C0
Read-Burst
Kernel
43
262,144


15
0x415BC1
0x42E3C0
Read-Burst
IFMAP
44
100,352


15
0x46E3C1
0x486BC0
Write-Burst
OFMAP
45
100,352


16
0x486BC1
0x487DC0
Read-Burst
Kernel
46
4,608


16
0x46E3C1
0x486BC0
Read-Burst
IFMAP
47
100,352


16
0x487DC1
0x4A05C0
Write-Burst
OFMAP
48
100,352


17
0x4A05C1
0x4E05C0
Read-Burst
Kernel
49
262,144


17
0x487DC1
0x4A05C0
Read-Burst
IFMAP
50
100,352


17
0x4E05C1
0x4F8DC0
Write-Burst
OFMAP
51
100,352


18
0x4F8DC1
0x4F9FC0
Read-Burst
Kernel
52
4,608


18
0x4E05C1
0x4F8DC0
Read-Burst
IFMAP
53
100,352


18
0x4F9FC1
0x5127C0
Write-Burst
OFMAP
54
100,352


19
0x5127C1
0x5527C0
Read-Burst
Kernel
55
262,144


19
0x4F9FC1
0x5127C0
Read-Burst
IFMAP
56
100,352


19
0x5527C1
0x56AFC0
Write-Burst
OFMAP
57
100,352


20
0x56AFC1
0x56C1C0
Read-Burst
Kernel
58
4,608


20
0x5527C1
0x56AFC0
Read-Burst
IFMAP
59
100,352


20
0x56C1C1
0x5849C0
Write-Burst
OFMAP
60
100,352


21
0x5849C1
0x5C49C0
Read-Burst
Kernel
61
262,144


21
0x56C1C1
0x5849C0
Read-Burst
IFMAP
62
100,352


21
0x5C49C1
0x5DD1C0
Write-Burst
OFMAP
63
100,352


22
0x5DD1C1
0x5DE3C0
Read-Burst
Kernel
64
4,608


22
0x5C49C1
0x5DD1C0
Read-Burst
IFMAP
65
100,352


22
0x5DE3C1
0x5F6BC0
Write-Burst
OFMAP
66
100,352


23
0x5F6BC1
0x636BC0
Read-Burst
Kernel
67
262,144


23
0x5DE3C1
0x5F6BC0
Read-Burst
IFMAP
68
100,352


23
0x636BC1
0x64F3C0
Write-Burst
OFMAP
69
100,352


24
0x64F3C1
0x6505C0
Read-Burst
Kernel
70
4,608


24
0x636BC1
0x64F3C0
Read-Burst
IFMAP
71
100,352


24
0x6505C1
0x6567C0
Write-Burst
OFMAP
72
25,088


25
0x6567C1
0x6D67C0
Read-Burst
Kernel
73
524,288


25
0x6505C1
0x6567C0
Read-Burst
IFMAP
74
25,088


25
0x6D67C1
0x6E2BC0
Write-Burst
OFMAP
75
50,176


26
0x6E2BC1
0x6E4FC0
Read-Burst
Kernel
76
9,216


26
0x6D67C1
0x6E2BC0
Read-Burst
IFMAP
77
50,176


26
0x6E4FC1
0x6F13C0
Write-Burst
OFMAP
78
50,176


27
0x6F13C1
0x7F13C0
Read-Burst
Kernel
79
1,048,576


27
0x6E4FC1
0x6F13C0
Read-Burst
IFMAP
80
50,176


27
0x7F13C1
0x7F17C0
Write-Burst
OFMAP
81
1,024


28
0x7F17C1
0x8EB7C0
Read-Burst
Kernel
82
1,024,000


28
0x7F13C1
0x7F17C0
Read-Burst
IFMAP
83
1,024


28
0x8EB7C1
0x8EBBA8
Write-Burst
OFMAP
84
1,000









An example of the present disclosure will be described with reference to Table 6 below.


Table 6 shows an example in which a kernel, a feature map, and an output feature map are stored in the main memory using a memory map of a specific address according to the memory operation sequence requested by the NPU based on the ANN data locality information ANN DL.


Table 6 is an example using substantially the same method as the example of Tables 3 and FIG. 30, and is an example of setting a memory map according to the artificial neural network data locality information of the artificial neural network model shown in FIG. 23.


According to the table below, after the input feature map is first read from the main memory, then the kernel is read and convolution is performed, and then the output feature map is stored in the main memory. The data request sequence of the NPU may be determined based on the ANN data locality information ANN DL. The AMC may analyze the ANN data locality information ANN DL, and sequentially arrange the data requested by the NPU. Therefore, the NPU can perform burst read and write operations.


The AMC controls the address allocation of the main memory to enable a burst operation. In Table 6 below, a common memory area configured to overwrite input feature maps and output feature maps of all layers is assigned based on the feature map having the largest data size. The convolution result for each layer is updated within the corresponding area. Accordingly, even if the start address of the common memory area is the same, the end address may be changed according to the size of the feature map.















TABLE 6








Operation

ANN
Size


Layer
Start address
End address
mode
Domain
DL
(Bytes)





















1
0x000000
0x0C4000
Read-Burst
IFMAP
1
802,816


1
0x0C4001
0x0C4360
Read-Burst
Kernel
2
864


1
0x000000
0x062000
Write-Burst
OFMAP
3
401,408


2
0x000000
0x062000
Read-Burst
IFMAP
4
401,408


2
0x0C4361
0x0C4480
Read-Burst
Kernel
5
288


2
0x000000
0x062000
Write-Burst
OFMAP
6
401,408


3
0x000000
0x062000
Read-Burst
IFMAP
7
401,408


3
0x0C4481
0x0C4C80
Read-Burst
Kernel
8
2,048


3
0x000000
0x0C4000
Write-Burst
OFMAP
9
802,816


4
0x000000
0x0C4000
Read-Burst
IFMAP
10
802,816


4
0x0C4C81
0x0C4EC0
Read-Burst
Kernel
11
576


4
0x000000
0x031000
Write-Burst
OFMAP
12
200,704


5
0x000000
0x031000
Read-Burst
IFMAP
13
200,704


5
0x0C4EC1
0x0C6EC0
Read-Burst
Kernel
14
8,192


5
0x000000
0x062000
Write-Burst
OFMAP
15
401,408


6
0x000000
0x062000
Read-Burst
IFMAP
16
401,408


6
0x0C6EC1
0x0C7340
Read-Burst
Kernel
17
1,152


6
0x000000
0x062000
Write-Burst
OFMAP
18
401,408


7
0x000000
0x062000
Read-Burst
IFMAP
19
401,408


7
0x0C7341
0x0CB340
Read-Burst
Kernel
20
16,384


7
0x000000
0x062000
Write-Burst
OFMAP
21
401,408


8
0x000000
0x062000
Read-Burst
IFMAP
22
401,408


8
0x0CB341
0x0CB7C0
Read-Burst
Kernel
23
1,152


8
0x000000
0x018800
Write-Burst
OFMAP
24
100,352


9
0x000000
0x018800
Read-Burst
IFMAP
25
100,352


9
0x0CB7C1
0x0D37C0
Read-Burst
Kernel
26
32,768


9
0x000000
0x031000
Write-Burst
OFMAP
27
200,704


10
0x000000
0x031000
Read-Burst
IFMAP
28
200,704


10
0x0D37C1
0x0D40C0
Read-Burst
Kernel
29
2,304


10
0x000000
0x031000
Write-Burst
OFMAP
30
200,704


11
0x000000
0x031000
Read-Burst
IFMAP
31
200,704


11
0x0D40C1
0x0E40C0
Read-Burst
Kernel
32
65,536


11
0x000000
0x031000
Write-Burst
OFMAP
33
200,704


12
0x000000
0x031000
Read-Burst
IFMAP
34
200,704


12
0x0E40C1
0x0E49C0
Read-Burst
Kernel
35
2,304


12
0x000000
0x00C400
Write-Burst
OFMAP
36
50,176


13
0x000000
0x00C400
Read-Burst
IFMAP
37
50,176


13
0x0E49C1
0x1049C0
Read-Burst
Kernel
38
131,072


13
0x000000
0x018800
Write-Burst
OFMAP
39
100,352


14
0x000000
0x018800
Read-Burst
IFMAP
40
100,352


14
0x1049C1
0x105BC0
Read-Burst
Kernel
41
4,608


14
0x000000
0x018800
Write-Burst
OFMAP
42
100,352


15
0x000000
0x018800
Read-Burst
IFMAP
43
100,352


15
0x105BC1
0x145BC0
Read-Burst
Kernel
44
262,144


15
0x000000
0x018800
Write-Burst
OFMAP
45
100,352


16
0x000000
0x018800
Read-Burst
IFMAP
46
100,352


16
0x145BC1
0x146DC0
Read-Burst
Kernel
47
4,608


16
0x000000
0x018800
Write-Burst
OFMAP
48
100,352


17
0x000000
0x018800
Read-Burst
IFMAP
49
100,352


17
0x146DC1
0x186DC0
Read-Burst
Kernel
50
262,144


17
0x000000
0x018800
Write-Burst
OFMAP
51
100,352


18
0x000000
0x018800
Read-Burst
IFMAP
52
100,352


18
0x186DC1
0x187FC0
Read-Burst
Kernel
53
4,608


18
0x000000
0x018800
Write-Burst
OFMAP
54
100,352


19
0x000000
0x018800
Read-Burst
IFMAP
55
100,352


19
0x187FC1
0x1C7FC0
Read-Burst
Kernel
56
262,144


19
0x000000
0x018800
Write-Burst
OFMAP
57
100,352


20
0x000000
0x018800
Read-Burst
IFMAP
58
100,352


20
0x1C7FC1
0x1C91C0
Read-Burst
Kernel
59
4,608


20
0x000000
0x018800
Write-Burst
OFMAP
60
100,352


21
0x000000
0x018800
Read-Burst
IFMAP
61
100,352


21
0x1C91C1
0x2091C0
Read-Burst
Kernel
62
262,144


21
0x000000
0x018800
Write-Burst
OFMAP
63
100,352


22
0x000000
0x018800
Read-Burst
IFMAP
64
100,352


22
0x2091C1
0x20A3C0
Read-Burst
Kernel
65
4,608


22
0x000000
0x018800
Write-Burst
OFMAP
66
100,352


23
0x000000
0x018800
Read-Burst
IFMAP
67
100,352


23
0x20A3C1
0x24A3C0
Read-Burst
Kernel
68
262,144


23
0x000000
0x018800
Write-Burst
OFMAP
69
100,352


24
0x000000
0x018800
Read-Burst
IFMAP
70
100,352


24
0x24A3C1
0x24B5C0
Read-Burst
Kernel
71
4,608


24
0x000000
0x006200
Write-Burst
OFMAP
72
25,088


25
0x000000
0x006200
Read-Burst
IFMAP
73
25,088


25
0x24B5C1
0x2CB5C0
Read-Burst
Kernel
74
524,288


25
0x000000
0x00C400
Write-Burst
OFMAP
75
50,176


26
0x000000
0x00C400
Read-Burst
IFMAP
76
50,176


26
0x2CB5C1
0x2CD9C0
Read-Burst
Kernel
77
9,216


26
0x000000
0x00C400
Write-Burst
OFMAP
78
50,176


27
0x000000
0x00C400
Read-Burst
IFMAP
79
50,176


27
0x2CD9C1
0x3CD9C0
Read-Burst
Kernel
80
1,048,576


27
0x000000
0x000400
Write-Burst
OFMAP
81
1,024


28
0x000000
0x000400
Read-Burst
IFMAP
82
1,024


28
0x3CD9C1
0x4C79C0
Read-Burst
Kernel
83
1,024,000


28
0x000000
0x0003E8
Write-Burst
OFMAP
84
1,000









Table 7 shows a memory map for the kernel domain stored in the main memory.


Table 8 shows a memory map for the input feature map domain stored in the main memory.


Table 9 shows a memory map for the output feature map domain stored in the main memory.


Referring to the address order of Tables 7 to 9, it is also possible to set the memory map of the main memory in such a way that the kernel domains are sequentially stored, the input feature map domains are sequentially stored, and the output feature map domains are sequentially stored.


The ANN data locality information ANN DL may be configured to set a memory map corresponding to each domain and perform a memory operation of a specific domain in a preset sequence.


For example, the ANN data locality information ANN DL may be set in the order of a kernel domain, an input feature map domain, and an output feature map domain.


For example, the ANN data locality information ANN DL may be set in the order of an input feature map domain, a kernel domain, and an output feature map domain.


The AMC may allocate and manage a memory address for each domain so that the main memory operates in a burst mode.


The data request sequence of the NPU may be determined based on the ANN data locality information ANN DL.


For the description of Tables 7 to 9, reference may be made to the first internal memory to the third internal memory of FIGS. 15A, 18, 19, 20, 21, and 22.


The SoC or NPU may be configured to include a first internal memory, a second internal memory, and a third internal memory. The first internal memory may correspond to a kernel domain. The second internal memory may correspond to the input feature map domain. The third internal memory may correspond to the output feature map domain.


The first internal memory will be described as an example. For example, the size of the first internal memory may be 1.5 Mbytes. Referring to Table 7, the size of the largest data in the kernel domain Kernel is 1,024,000 bytes. Therefore, tiling may be unnecessary.


The second internal memory will be described as an example. For example, the size of the second internal memory may be 0.5 Mbyte. Referring to Table 8, the largest data in the input feature map domain IFMAP is 802,816 bytes. Therefore, tiling may be necessary.


Referring to the artificial neural network data locality ANN DL corresponding to the first layer and the fourth layer of the input feature map domain IFMAP of Table 8, each layer may be divided into two tiles. For example, the first layer and the fourth layer may be divided into a first tile In-1-1, a second tile In-1-2, a third tile In-4-1, and a fourth tile In-4-2 of 401,408 bytes. Therefore, even if the size of the second internal memory is 0.5 Mbyte, memory overflow can be prevented. To elaborate, the example of Table 8 is a case in which there is no tiling, and the size of each of the input feature maps IFMAP of the first layer and the fourth layer is 802,816 bytes that are not tiled. In the case of Table 8, the size of the second internal memory may be larger than the maximum data size of the input feature map domain, and in this case, tiling may not be necessary.


The third internal memory will be described as an example. For example, the size of the third internal memory may be 1 Mbyte. Referring to Table 9, the size of the largest data in the output feature map domain OFMAP is 1,024,000 bytes. Therefore, tiling may be unnecessary.


To elaborate, the standard of the tiling may vary according to the tiling standard of the buffer memory of the AMC or the tiling standard of the NPU internal memory.


The number of tiles of the input feature map may be determined according to a value obtained by dividing the size of the input feature map by the size of the input feature map memory of the layer number.


In the examples of Tables 7 to 9, a memory area corresponding to the data size of the feature map having the largest data size is set, and the convolution result for each layer is updated in the corresponding area. Accordingly, the ANN data locality information ANN DL may be updated.


Depends on the size of the feature map, the end address in the memory may be changed. For example, the end address may be changed only within the fixed area having the largest size.


A plurality of small sized weights may be cached in a cache memory of the AMC with one burst command.


For example, if the maximum burst length is 16 Kb (K-1˜K-6) has a total size of 13 Kb, it can be cached in the cache memory of the AMC at once with a single burst command.


In this case, the AMC can request only (In-1 to In-6) from the main memory up to (K-1 to K-6).















TABLE 7








Operation

ANN
Size


Layer
Start address
End address
mode
Domain
DL
(Bytes)





















1
0x000000
0x000360
Read-Burst
Kernel
K-1
864


2
0x000361
0x000480
Read-Burst
Kernel
K-2
288


3
0x000481
0x000C80
Read-Burst
Kernel
K-3
2,048


4
0x000C81
0x000EC0
Read-Burst
Kernel
K-4
576


5
0x000EC1
0x002EC0
Read-Burst
Kernel
K-5
8,192


6
0x002EC1
0x003340
Read-Burst
Kernel
K-6
1,152


7
0x003341
0x007340
Read-Burst
Kernel
K-7
16,384


8
0x007341
0x0077C0
Read-Burst
Kernel
K-8
1,152


9
0x0077C1
0x00F7C0
Read-Burst
Kernel
K-9
32,768


10
0x00F7C1
0x0100C0
Read-Burst
Kernel
K-10
2,304


11
0x0100C1
0x0200C0
Read-Burst
Kernel
K-11
65,536


12
0x0200C1
0x0209C0
Read-Burst
Kernel
K-12
2,304


13
0x0209C1
0x0409C0
Read-Burst
Kernel
K-13
131,072


14
0x0409C1
0x041BC0
Read-Burst
Kernel
K-14
4,608


15
0x041BC1
0x081BC0
Read-Burst
Kernel
K-15
262,144


16
0x081BC1
0x082DC0
Read-Burst
Kernel
K-16
4,608


17
0x082DC1
0x0C2DC0
Read-Burst
Kernel
K-17
262,144


18
0x0C2DC1
0x0C3FC0
Read-Burst
Kernel
K-18
4,608


19
0x0C3FC1
0x103FC0
Read-Burst
Kernel
K-19
262,144


20
0x103FC1
0x1051C0
Read-Burst
Kernel
K-20
4,608


21
0x1051C1
0x1451C0
Read-Burst
Kernel
K-21
262,144


22
0x1451C1
0x1463C0
Read-Burst
Kernel
K-22
4,608


23
0x1463C1
0x1863C0
Read-Burst
Kernel
K-23
262,144


24
0x1863C1
0x1875C0
Read-Burst
Kernel
K-24
4,608


25
0x1875C1
0x2075C0
Read-Burst
Kernel
K-25
524,288


26
0x2075C1
0x2099C0
Read-Burst
Kernel
K-26
9,216


27
0x2099C1
0x3099C0
Read-Burst
Kernel
K-27
1,048,576


28
0x3099C1
0x4039C0
Read-Burst
Kernel
K-28
1,024,000






















TABLE 8








Operation

ANN
Size


Layer
Start address
End address
mode
Domain
DL
(Bytes)





















1
0x4039C1
0x4659C0
Read-Burst
IFMAP
In-1-1
401,408


1
0x4039C0
0x4C79C0
Read-Burst
IFMAP
In-1-2
401,408


2
0x4039C1
0x4659C0
Read-Burst
IFMAP
In-2
401,408


3
0x4039C1
0x4659C0
Read-Burst
IFMAP
In-3
401,408


4
0x4039C1
0x4C79C0
Read-Burst
IFMAP
In-4-1
401,408


4
0x4039C1
0x4C79C0
Read-Burst
IFMAP
In-4-2
401,408


5
0x4039C1
0x4349C0
Read-Burst
IFMAP
In-5
200,704


6
0x4039C1
0x4659C0
Read-Burst
IFMAP
In-6
401,408


7
0x4039C1
0x4659C0
Read-Burst
IFMAP
In-7
401,408


8
0x4039C1
0x4659C0
Read-Burst
IFMAP
In-8
401,408


9
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-9
100,352


10
0x4039C1
0x4349C0
Read-Burst
IFMAP
In-10
200,704


11
0x4039C1
0x4349C0
Read-Burst
IFMAP
In-11
200,704


12
0x4039C1
0x4349C0
Read-Burst
IFMAP
In-12
200,704


13
0x4039C1
0x40FDC0
Read-Burst
IFMAP
In-13
50,176


14
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-14
100,352


15
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-15
100,352


16
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-16
100,352


17
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-17
100,352


18
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-18
100,352


19
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-19
100,352


20
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-20
100,352


21
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-21
100,352


22
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-22
100,352


23
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-23
100,352


24
0x4039C1
0x41C1C0
Read-Burst
IFMAP
In-24
100,352


25
0x4039C1
0x409BC0
Read-Burst
IFMAP
In-25
25,088


26
0x4039C1
0x40FDC0
Read-Burst
IFMAP
In-26
50,176


27
0x4039C1
0x40FDC0
Read-Burst
IFMAP
In-27
50,176


28
0x4039C1
0x403DC0
Read-Burst
IFMAP
In-28
1,024






















TABLE 9








Operation

ANN
Size


Layer
Start address
End address
mode
Domain
DL
(Bytes)





















1
0x40390
0x4659C0
Write-Burst
OFMAP
Out-1
401,408


2
0x40390
0x4659C0
Write-Burst
OFMAP
Out-2
401,408


3
0x40390
0x4C79C0
Write-Burst
OFMAP
Out-3
802,816


4
0x40390
0x4349C0
Write-Burst
OFMAP
Out-4
200,704


5
0x4039C1
0x4659C0
Write-Burst
OFMAP
Out-5
401,408


6
0x4039C1
0x4659C0
Write-Burst
OFMAP
Out-6
401,408


7
0x4039C1
0x4659C0
Write-Burst
OFMAP
Out-7
401,408


8
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-8
100,352


9
0x4039C1
0x4349C0
Write-Burst
OFMAP
Out-9
200,704


10
0x4039C1
0x4349C0
Write-Burst
OFMAP
Out-10
200,704


11
0x4039C1
0x4349C0
Write-Burst
OFMAP
Out-11
200,704


12
0x4039C1
0x40FDC0
Write-Burst
OFMAP
Out-12
50,176


13
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-13
100,352


14
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-14
100,352


15
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-15
100,352


16
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-16
100,352


17
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-17
100,352


18
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-18
100,352


19
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-19
100,352


20
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-20
100,352


21
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-21
100,352


22
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-22
100,352


23
0x4039C1
0x41C1C0
Write-Burst
OFMAP
Out-23
100,352


24
0x4039C1
0x409BC0
Write-Burst
OFMAP
Out-24
25,088


25
0x4039C1
0x40FDC0
Write-Burst
OFMAP
Out-25
50,176


26
0x4039C1
0x40FDC0
Write-Burst
OFMAP
Out-26
50,176


27
0x4039C1
0x403DC0
Write-Burst
OFMAP
Out-27
1,024


28
0x4039C1
0x403DA8
Write-Burst
OFMAP
Out-28
1,000










FIG. 31 shows a graph measuring the bandwidth of the data bus between the buffer memory (cache) and the main memory.


The graph shown in FIG. 31 shows the result of measuring the bandwidth when the buffer memory (cache) and the main memory are connected through the AXI4 interface.


The measurement of the bandwidth was performed in a situation in which 2 Mbyte of data was read from the DRAM, which is the main memory, to the SRAM, which is the buffer memory, 10 times for each AXI burst length (1 to 16). The AXI interface can adjust the burst length.


The graph shown in FIG. 31 may be summarized in a table as follows.
















TABLE 10







Burst length
1
2
4
8
16






















Linear
Time (ns)
2,310,440
1,198,699
654,484
378,766
242,023


Address
Bandwidth
6.93
13.35
24.45
42.24
66.11



(Gb/sec)


Random
Time (ns)
6,108,015
1,738,665
983,017
617,457
363,018


Address
Bandwidth
2.62
9.20
16.28
25.91
44.07



(Gb/sec)









When the address is linear regardless of the burst length, the transmission bandwidth, that is, the transmission speed is improved.


If the burst length is the same, using a linear address may result in a faster transfer rate. It may be advantageous to efficiently allocate the address of the DRAM, which is the main memory, to enable the read-burst.


The burst length means a length of reading at a time in bursts. In the linear case, even if the burst length is short, since the DRAM addresses are sequentially incremental, the RAS latency and/or the CAS latency can be reduced.


That is, if the memory map of the main memory is set linearly based on the ANN data locality information, the bandwidth increases compared to the random case. Accordingly, the effective bandwidth between the main memory and the buffer memory can be increased.



FIG. 32 is an exemplary diagram illustrating an architecture including a compiler.


The compiler may convert the artificial neural network model into machine code that can be run in the NPU.


The compiler may include a frontend and a backend. An intermediate representation (IR) may exist between the frontend and the backend. These IRs are abstract concepts of programs and are used for program optimization. The artificial neural network model can be converted to various levels of IR.


The high-level IR may be on the frontend of the compiler. The frontend of the compiler receives information about the artificial neural network model. For example, the information on the artificial neural network model may be the information exemplified in FIG. 23. The front end of the compiler may perform hardware-independent conversion and optimization.


The high-level IR may be at the graph level, and can optimize computation and control flow. The low-level IR may be located at the end of the compiler.


The backend of the compiler may convert the high-level IR to the low-level IR. The backend of the compiler may perform NPU optimization, CODE generation, and compilation.


The backend of the compiler may perform optimization tasks such as hardware intrinsic mapping, memory-allocation, and the like.


The ANN data locality information may be generated or defined in a low-level IR.


The ANN data locality information may include all memory operation sequence information to be requested by the NPU to the main memory. Therefore, the AMC can know the sequence of all memory operations that the NPU will request. As described above, the compiler may generate the ANN data locality information, or the AMC may generate the ANN data locality information by analyzing the repetition pattern of the memory operation commands requested by the NPU from the main memory.


ANN data locality information may be generated in the form of a register map or a lookup table.


After analyzing or receiving the ANN data locality information ANN DL, the compiler may generate a caching schedule of the AMC and/or the NPU based on the ANN DL. The caching schedule may include a caching schedule of an on-chip memory of the NPU and/or a caching schedule of a buffer memory of the AMC.


Meanwhile, the compiler may compile an artificial neural network model with optimization algorithms (e.g., Quantization, Pruning, Retraining, Layer fusion, Model Compression, Transfer Learning, AI Based Model Optimization, and another Model Optimizations).


In addition, the compiler may generate ANN data locality information of the artificial neural network model optimized for the NPU. The ANN data locality information may be separately provided to the AMC, and it is also possible for the NPU and the AMC to receive the same ANN data locality information, respectively. Also, as described above with reference to FIG. 14, there may be at least one AMC.


The ANN data locality information may include an operation sequence configured in a unit of memory operation request of the NPU, a data domain, a data size, a memory address map configured for sequential addressing.


The scheduler in the illustrated NPU may control an artificial neural network operation by receiving a binary machine code from the compiler.


The compiler may provide sequentially assigned memory address map information of the main memory to the DMA, which is the ANN memory controller (AMC), and the AMC may arrange or rearrange the artificial neural network model data in the main memory based on the sequential memory address map. The AMC may perform data reordering operations in the main memory during initialization of the NPU or runtime.


In this case, the AMC may optimize the read-burst operation in performing the arrangement or rearrangement. The arrangement or rearrangement may be performed when the NPU operation is initialized. In addition, the arrangement or rearrangement may be performed upon detection of a change in the ANN DL. These functions may be independently performed in the AMC during NPU operation without the compiler.


The AMC and the NPU may receive or provide the ANN data locality information to each other. That is, the compiler may provide the ANN data locality information to the AMC and the NPU. The AMC may be provided with information on the operation sequence of the ANN data locality information being processed by the NPU in real time. In addition, the AMC may synchronize the ANN data locality information with the NPU.


If the NPU is processing data corresponding to the ANN data locality information of token #N, the AMC predicts that data corresponding to the ANN data locality information of token #(N+1) will be requested from the NPU, considers the latency of the main memory, and requests the data corresponding to the ANN data locality information of token #(N+1) to the main memory. The corresponding operation may be independently performed by the AMC before receiving memory operation request from the NPU.


The compiler may generate a caching policy to store data necessary for a predicted operation according to ANN data locality in a buffer memory in the AMC. The compiler caches as much data as possible before the NPU requests it according to the buffer size of the DMA.


For example, the compiler may provide a caching policy to AMC to cache up to ANN data locality information token #(N+M). Here, M may be an integer value that satisfies the case where the data size of the ANN data locality information tokens #(N+1) to #(N+M) is smaller than or equal to the cache memory capacity of the AMC.


The compiler may determine that when the remaining cache memory capacity of the AMC is larger than the data size of the ANN data locality information token #(N+M+1), the ANN data locality information token #(N+M+1) data may be stored in an area in which data corresponding to the ANN data locality information token #(N) is stored.


To elaborate, the caching may be performed independently by the AMC without a command of the NPU based on the ANN DL stored in the ANN data locality information management unit of the AMC.


The compiler may provide a model lightening function. The compiler can further optimize and lighten the deep learning model to fit the corresponding NPU architecture.


The features, structures, effects and the like described in the foregoing embodiments are included in one embodiment of the present disclosure and are not necessarily limited to one embodiment. Moreover, the features, structures, effects and the like illustrated in each embodiment may be combined or modified by those skilled in the art for the other embodiments to be carried out. Therefore, the combination and the modification of the present disclosure are interpreted to be included within the scope of the present disclosure.


In the above description, the present disclosure has been described based on the example, but the examples are for illustrative, and do not limit the present invention, and those skilled in the art will appreciate that various modifications and applications, which are not exemplified in the above description, may be made without departing from the scope of the essential characteristic of the present examples. For example, each constituent element specifically present in the example may be modified and carried out. Further, the differences related to the modification and the application should be construed as being included in the scope of the present invention defined in the accompanying claims.


[National R&D Project Supporting This Invention]


[Task Identification Number] 1711117015


[Task Number] 2020-0-01297-001


[Name of Ministry] Ministry of Science and ICT


[Name of Project Management (Specialized) Institution] Institute of


Information & Communications Technology Planning & Evaluation


[Research Project Title] Next-generation Intelligent Semiconductor Technology Development (Design) (R&D)


[Research Task Title] Technology Development of a Deep Learning Processor Advanced to Reuse Data for Ultra-low Power Edge


[Contribution Rate] 1/1


[Name of Organization Performing the Task] DeepX Co., Ltd.


[Research period] 2020.04.01˜2020.12.31

Claims
  • 1. A memory system of an artificial neural network (ANN), the memory system comprising: a processor configured to process an ANN model; andan ANN memory controller configured to control a rearrangement of data of the ANN model stored in a memory, andoperate the data of the ANN model stored in the memory in a read-burst mode based on ANN data locality information of the ANN model.
  • 2. The memory system of claim 1, wherein the ANN memory controller is further configured to receive pre-generated ANN data locality information.
  • 3. The memory system of claim 1, wherein the processor is further configured to generate a plurality of data access requests sequentially, andwherein the ANN memory controller is further configured to generate the ANN data locality information by monitoring the plurality of data access requests.
  • 4. The memory system of claim 1, wherein the ANN memory controller is further configured to control communication between the processor and the memory in which the data of the ANN model is stored.
  • 5. The memory system of claim 1, wherein the ANN memory controller is further configured to rearrange the data of the ANN model stored in the memory in a forward direction based on the ANN data locality information.
  • 6. The memory system of claim 1, wherein the processor is further configured to generate a plurality of data access requests sequentially, each of the plurality of data access requests including a memory address of the memory, andwherein the ANN memory controller is further configured to rearrange the data of the ANN model by monitoring the memory addresses of the plurality of data access requests.
  • 7. A memory system of an artificial neural network (ANN), the memory system comprising: a processor configured to generate a data access request for processing a neural network model;an ANN memory controller configured to generate a memory access request corresponding to the data access request based on ANN data locality information of the ANN model; anda memory configured to provide data corresponding to the memory access request to the ANN controller in a read-burst mode based on the ANN data locality information.
  • 8. The memory system of claim 7, wherein the processor is further configured to generate a plurality of data access requests sequentially, andwherein the ANN memory controller is further configured to determine whether the plurality of data access requests are operable in the read-burst mode based on memory addresses of the memory corresponding to the plurality of data access requests.
  • 9. The memory system of claim 8, wherein, if it is determined that the memory cannot operate in the read-burst mode, the ANN memory controller is further configured to store data corresponding to the plurality of data access requests in memory addresses of the memory, the memory addresses enabling the read-burst mode.
  • 10. The memory system of claim 8, wherein the memory addresses of the memory include a first memory address corresponding to a data access request of the plurality of data access requests and a second memory address enabling operation of the read-burst mode, andwherein the ANN memory controller is further configured to exchange data stored in the first memory address and data stored in the second memory address.
  • 11. The memory system of claim 7, wherein the ANN memory controller is further configured to set a specific memory area of the memory for the read-burst mode based on the ANN data locality information.
  • 12. A memory system of an artificial neural network (ANN), the memory system comprising: a processor configured to process an ANN model;at least one memory configured to store data of the ANN model; andan ANN memory controller configured to increase an operation rate in a read-burst mode of the data stored in the at least one memory by analyzing a continuity of memory addresses of sequential memory access requests generated based on ANN data locality information of the ANN model.
  • 13. The memory system of claim 12, wherein the ANN memory controller includes a cache memory, andwherein the cache memory is configured to store the data provided by the read-burst mode.
  • 14. The memory system of claim 12, wherein the ANN memory controller includes a cache memory, andwherein the cache memory is configured to store a weight value corresponding to the ANN data locality information of the ANN model.
  • 15. The memory system of claim 12, wherein the at least one memory includes a plurality of memories, andwherein the ANN memory controller is further configured to distribute and store the data of the ANN model in the plurality of memories.
  • 16. The memory system of claim 12, wherein the ANN memory controller is further configured to control a refresh timing of a specific global bit line of the at least one memory, based on the ANN data locality information of the ANN model and a memory address at which the data of the ANN model is stored.
  • 17. The memory system of claim 12, wherein the ANN memory controller is further configured to obtain mapping data in which memory access requests corresponding to data access requests generated by the processor are mapped to each other based on the ANN data locality information.
  • 18. The memory system of claim 12, wherein the ANN memory controller is further configured to rearrange the data of the ANN model stored in the at least one memory based on the ANN data locality information.
  • 19. The memory system of claim 12, wherein the at least one memory includes a volatile or a non-volatile memory having the read-burst mode.
  • 20. The memory system of claim 12, wherein the ANN memory controller is further configured to rearrange the data of the ANN model stored in the at least one memory so as to optimize for the read-burst mode, based on the ANN data locality information of the ANN model, andupdate the ANN data locality information of the ANN model to correspond to the rearranged data.
Priority Claims (2)
Number Date Country Kind
10-2020-0144308 Nov 2020 KR national
10-2021-0044772 Apr 2021 KR national