WO2024214878A1 - Electronic device for prefetching data by predicting memory address and method for operating same - Google Patents
Electronic device for prefetching data by predicting memory address and method for operating same Download PDFInfo
- Publication number
- WO2024214878A1 WO2024214878A1 PCT/KR2023/012771 KR2023012771W WO2024214878A1 WO 2024214878 A1 WO2024214878 A1 WO 2024214878A1 KR 2023012771 W KR2023012771 W KR 2023012771W WO 2024214878 A1 WO2024214878 A1 WO 2024214878A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- prefetch
- memory
- request
- cache
- preloader
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 29
- 230000004044 response Effects 0.000 claims abstract description 56
- 238000005070 sampling Methods 0.000 claims abstract description 4
- 238000011017 operating method Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 12
- 238000012545 processing Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 238000012546 transfer Methods 0.000 description 6
- 238000011160 research Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000000926 separation method Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 239000000969 carrier Substances 0.000 description 1
- 238000013075 data extraction Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000001537 neural effect Effects 0.000 description 1
- 230000036316 preload Effects 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0862—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with prefetch
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1016—Performance improvement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/60—Details of cache memory
- G06F2212/602—Details relating to cache prefetching
Definitions
- An electronic device and method of operating the same for prefetching data by predicting a memory address are described.
- the processor can execute applications such as machine learning and blockchain.
- applications such as machine learning and blockchain.
- a pipeline stall may occur because the operation by the next instruction is executed after the operation by one instruction is completed.
- the processor can perform better as the pipeline stall is reduced. Therefore, research is actively being conducted to reduce this pipeline stall.
- the present disclosure can reduce pipeline stalls by preloading memory required for the next operation into a preloader cache using the memory address used in the operation.
- the present disclosure can reduce pipeline stalls by prefetching memory required for the next operation into the preloader cache, thereby eliminating the need to load data into the L1 cache again even if the data is fetched from the L1 cache.
- An operating method of an electronic device may include the steps of sampling prior demand memory addresses included in a prior demand memory request, generating a prefetch memory request based on a stride between the sampled prior demand memory addresses, transmitting a prefetch memory response according to the prefetch memory request to a preloader, and storing prefetch data included in the prefetch memory response and a prefetch memory address corresponding to the prefetch data in a preloader cache.
- the step of generating the above prefetch memory request can predict the prefetch memory address based on the step, and generate the prefetch memory request including the prefetch memory address.
- the stride includes one or a combination of two or more of an intra-warp pattern stride and an inter-warp pattern stride, and the step of generating the prefetch memory request can determine the prefetch memory request by determining a priority of the intra-warp pattern stride higher than that of the inter-warp pattern stride.
- the step of generating the above prefetch memory request may include generating the prefetch memory request based on the intra-warp pattern stride when the stride includes both an intra-warp pattern stride and an inter-warp pattern stride and the prefetch memory addresses based on each of the intra-warp pattern stride and the inter-warp pattern stride are different.
- the method may further include a step of transmitting a demand memory request for a next operation from a load/store unit (LDST unit) to the preloader, and a step of transmitting data required for the next operation to the LDST unit based on a demand memory address included in the demand memory request and the prefetch memory address.
- LDST unit load/store unit
- the step of transmitting data required for the above-described next operation to the LDST unit may include transmitting the prefetch data corresponding to the prefetch memory address from the preloader cache to the LDST unit when the requested memory address and the prefetch memory address match.
- the step of transmitting data required for the above-described next operation to the LDST unit may include, when the requested memory address and the prefetch memory address are different, transmitting the requested memory request to a lower cache, and transmitting the data from the lower cache that received the requested memory request to the LDST unit.
- the above preloader cache may include a plurality of entries, and each of the plurality of entries may include a status bit indicating a status of the entry.
- the method may further include updating the status bits depending on whether the prefetch memory request has been generated, whether the prefetch memory response has reached the preloader before the requested memory request is generated, and whether the requested memory address and the prefetch memory address match.
- the step of storing in the above preloader cache may generate a plurality of sub-prefetch memory requests and store the prefetch memory address based on the plurality of sub-prefetch memory requests.
- a method of operating an electronic device may include the steps of generating a prefetch memory request based on a stride of sampled previous request memory addresses, storing prefetch data included in a prefetch memory response which is a response to the prefetch memory request and a prefetch memory address corresponding to the prefetch data in a preloader cache, determining whether a request memory address included in a request memory request for a next operation generated from an LDST unit and the prefetch memory address stored in the preloader cache match, and if the request memory address and the prefetch memory address match, transmitting the prefetch data to the LDST unit, and if the request memory address and the prefetch memory address do not match, forwarding the request memory request to a lower cache of the preloader cache.
- An electronic device includes a processor configured to sample prior demand memory addresses included in a prior demand memory request, generate a prefetch memory request based on a stride between the sampled prior demand memory addresses, transmit a prefetch memory response according to the prefetch memory request to a preloader, and store prefetch data included in the prefetch memory response and a prefetch memory address corresponding to the prefetch data in a preloader cache, wherein the processor includes the preloader that generates the prefetch memory request, and the preloader may include the preloader cache that stores the prefetch memory address and the prefetch data.
- the processor can predict the prefetch memory address based on the stride and generate the prefetch memory request including the prefetch memory address.
- the above stride includes one or a combination of two or more of an intra-warp pattern stride and an inter-warp pattern stride, and the processor can determine the prefetch memory request by determining a priority of the intra-warp pattern stride higher than that of the inter-warp pattern stride.
- the processor may generate the prefetch memory request based on the intra-warp pattern stride, when the stride includes both an intra-warp pattern stride and an inter-warp pattern stride, and the prefetch memory addresses based on each of the intra-warp pattern stride and the inter-warp pattern stride are different.
- the above processor can transmit a demand memory request for the next operation from the LDST unit to the preloader, and transmit data required for the next operation to the LDST unit based on a demand memory address included in the demand memory request and the prefetch memory address.
- the processor can transmit the prefetch data corresponding to the prefetch memory address from the preloader cache to the LDST unit when the requested memory address and the prefetch memory address match.
- the processor can, if the requested memory address and the prefetch memory address are different, transfer the requested memory request to a lower cache and transmit the data from the lower cache that received the requested memory request to the LDST unit.
- the above preloader cache may include status bits indicating the status of entries included in the preloader cache.
- the processor can generate a plurality of sub-prefetch memory requests and merge the plurality of sub-prefetch memory requests to generate the prefetch memory address.
- pipeline stalls can be reduced by preloading memory required for the next operation into a preloader cache.
- FIG. 1 is a diagram illustrating an electronic device according to one embodiment of the present disclosure.
- FIG. 2 is a diagram illustrating a GPU according to one embodiment of the present disclosure.
- Figures 3a and 3b are drawings for explaining the stride.
- Figures 4a to 4d are diagrams for explaining multiple prefetching scenarios.
- FIG. 5 is a flow chart illustrating the operation of an electronic device including a preloader according to one embodiment of the present disclosure.
- FIG. 6 is a flow chart for explaining the operation of a GPU according to one embodiment of the present disclosure.
- FIGS. 7A to 7C are drawings for explaining the operation of a preloader according to one embodiment of the present disclosure.
- FIG. 8 is a diagram for explaining a status update of an entry according to one embodiment of the present disclosure.
- FIG. 9 is a flowchart for explaining the operation of an electronic device according to one embodiment of the present disclosure.
- first or second may be used to describe various components, these terms should be understood only for the purpose of distinguishing one component from another.
- a first component may be referred to as a second component, and similarly, a second component may also be referred to as a first component.
- FIG. 1 is a diagram illustrating an electronic device according to one embodiment of the present disclosure.
- the electronic device (100) may include a processor (110). Only components related to embodiments of the present disclosure are illustrated in the electronic device (100) illustrated in FIG. 1. Accordingly, it is apparent to a person skilled in the art that the electronic device (100) may further include other general components in addition to the components illustrated in FIG. 5.
- the processor (110) may perform a role of performing overall functions for controlling the electronic device (100).
- the processor (110) may control the electronic device (100) overall by executing programs and/or commands stored in a memory (not shown).
- the processor (110) may be implemented as a central processing unit (CPU), a graphics processing unit (GPU), a tensor processing unit (TPU), and a neural processing unit (NPU) provided in the electronic device (100), but is not limited thereto.
- the processor (110) may include a preloader (111).
- the preloader (111) may include a cache (not shown).
- the preloader (111) is a type of prefetcher, but will be referred to as a preloader (111) to distinguish it from a prefetcher that does not include a cache (not shown).
- the cache (not shown) included in the preloader (111) may be referred to as a preloader cache.
- the preloader (111) may calculate a stride using a memory address already generated in a previous operation.
- the preloader (111) may predict a next memory address using this stride.
- the preloader (111) may generate a prefetch memory request to preload data stored in the predicted next memory address into the preloader cache.
- FIG. 2 is a diagram illustrating a GPU according to one embodiment of the present disclosure.
- the GPU (200) may include a thread block scheduler, a plurality of streaming multiprocessors (210-1, 210-2, 210-N), an inter connection, a shared L2 cache (220), and a global memory (230).
- Each of a plurality of streaming multiprocessors (210-1, 210-2, 210-N) (hereinafter, SM) can execute thousands of threads simultaneously.
- Each SM can include hundreds of cores called streaming processors (hereinafter, SPs) (213).
- the SPs (213) can perform arithmetic operations. Threads scheduled to the SMs can be divided into a plurality of warps.
- the plurality of warps can be scheduled to the SPs (213) by a warp scheduler (211) according to various scheduling policies.
- the GPU (200) may have a memory hierarchy similar to that of the CPU.
- the SM may include a large-sized register file (212).
- the SM may include an L1 cache (216) and a scratchpad memory (217) as lower layers of the register file (212).
- the GPU (200) may include a shared L2 cache (220) and a global memory (230) shared by all scheduled threads.
- Data may need to be loaded into the register file (212) in order to be used by an instruction. Therefore, memory latency can be reduced through prefetching, which loads data in advance into the immediate lower cache of the register file (212).
- the SM may include a preloader (215).
- the preloader (215) may perform prefetching.
- the preloader (215) may be a type of prefetcher that performs prefetching.
- the preloader (215) may further include a preloader cache that stores a prefetch memory address and prefetch data therein.
- the preloader (215) can prefetch data from the lower cache, the L1 cache (216), the shared L2 cache (220), or the global memory (230).
- data prefetched from the L1 cache (216), the shared L2 cache (220), or the global memory (230) will be referred to as prefetch data.
- the address of the memory where the prefetch data is stored will be referred to as a prefetch memory address.
- the preloader (215) can store the prefetch data in the preloader cache.
- the preloader cache can also be referred to as an L0 cache in the sense that it is higher than the L1 cache. In other words, the L0 cache can be used to store the prefetch data.
- the preloader (215) When the preloader (215) receives a demand memory request from the LDST unit (load/store unit), it can compare the demand memory address included in the demand memory request with the prefetch memory address included in the preloader cache. Depending on the comparison result, the preloader (215) can pass the prefetch data to the LDST unit or pass the required memory request to the lower cache.
- Figures 3a and 3b are diagrams for explaining the stride.
- the method described below can also be applied to a preloader including a preloader cache.
- the prefetch data can be stored in the preloader cache rather than the L1 cache, as described in FIG. 6, FIG. 7a, FIG. 7b, and FIG. 7c.
- FIGS. 3A and 3B a method for determining a stride for predicting a prefetch memory address is illustrated.
- FIG. 3A illustrates a method for determining an intra-warp pattern stride and prefetching data.
- FIG. 3B illustrates a method for determining an inter-warp pattern stride and prefetching data.
- block (301) may represent a previous request memory address according to a previous request memory request.
- Block (303) may represent a prefetch memory address included in a prefetch memory request.
- Block (305) may represent a request memory address included in a request memory request for a next operation.
- the previous requested memory address according to the previous requested memory request may mean a memory address where data used in the previous operation is stored.
- the prefetch memory address included in the prefetch memory request may mean a memory address where data predicted by the prefetcher to be used in the next operation is stored.
- the requested memory address included in the requested memory request for the next operation may mean a memory address where data required for the next operation requested by the LDST unit is stored.
- Intra-warp pattern stride may be an algorithm that predicts a prefetch memory address by using the stride between request memory requests generated from the same warp.
- the prefetcher may sample previous request memory addresses included in previous request memory requests generated from the same warp.
- the prefetcher may determine a prefetch memory address based on the stride between the sampled previous request memory addresses.
- the prefetcher may load and store prefetch data, which is data stored in the determined prefetch memory address, into an L1 cache. That is, the prefetcher may perform prefetching on the prefetch data. Thereafter, when there is a request memory request for the next operation, the prefetcher may compare the request memory address included in the request memory request with the prefetch memory address stored in the L1 cache. If the request memory address and the prefetch memory address match, the prefetcher may transfer the prefetch data from the L1 cache to the LDST unit.
- the prefetcher can sample previous request memory addresses included in a previous request memory request generated from the same warp #00.
- the prefetcher can calculate a stride between the previous request memory addresses 0x0100 and 0x0200 (1 in FIG. 3a).
- the stride can be 0x0100, which is a difference between 0x0100 and 0x0200.
- the prefetcher can use the stride to predict a prefetch memory address where prefetch data required for the next operation is stored as 0x0300 (2 in FIG. 3a).
- the prefetcher can load and store the prefetch data located at 0x0300 in the L1 cache.
- the LDST unit can transmit the request memory request to the L1 cache.
- the prefetch data stored in the L1 cache and corresponding to the prefetch memory address 0x0300 can be transmitted to the LDST unit.
- the requested memory address and the prefetch memory address are different, the requested memory request can be forwarded to a lower cache (e.g., L2 cache).
- Inter-warp pattern stride can be an algorithm that predicts prefetch memory addresses by using strides between request memory requests generated from different warps.
- the prefetcher can sample previous request memory addresses included in previous request memory requests generated from different warps.
- the step of determining the stride by using the sampled previous request memory addresses is the same as the intra-warp pattern stride, so the description will be omitted.
- the prefetcher can sample previous request memory addresses 0x0100 and 0x0200 from different warp #00 and warp #01, respectively.
- the prefetcher can determine a stride as 0x0100 using the previous request memory addresses 0x0100 and 0x0200 (1 in FIG. 3b).
- the prefetcher can predict a prefetch memory address where prefetch data required by warp #02 for the next operation is located as 0x0300 using the stride (2 in FIG. 3b).
- the prefetcher can load and store the prefetch data located at 0x0300 into the L1 cache.
- the LDST unit can transmit the request memory request to the L1 cache.
- the prefetch data stored in the L1 cache and corresponding to the prefetch memory address 0x0300 can be transmitted to the LDST unit.
- the requested memory address and the prefetch memory address are different, the requested memory request can be forwarded to a lower cache (e.g., L2 cache).
- Figures 4a to 4d are diagrams for explaining multiple prefetching scenarios.
- the GPU (400) may include a streaming multiprocessor (410), an interconnection (420), an L2 cache (430), and a global memory (440).
- the streaming multiprocessor (410) may include a register file (411), an LDST unit (413), a prefetcher (415), and an L1 cache (417).
- the prefetcher (415) can predict a prefetch memory address, which is an address of prefetch data to be used for the next operation.
- the prefetcher (415) can generate a prefetch memory request including the prefetch memory address, and transmit the prefetch memory request to the L1 cache.
- the prefetch memory request can check whether prefetch data corresponding to the prefetcher memory address is loaded in the L1 cache. If the prefetch data is not loaded, a cache miss may occur. If a cache miss occurs, the prefetch memory request may be transmitted to the L2 cache (430), which is a lower cache, and/or the global memory (440) through the interconnection (420).
- a prefetch memory response according to the prefetch memory request may be generated.
- the prefetch memory response may be transmitted to the L1 cache (417) via the interconnection (420).
- the prefetch memory response may include prefetch data corresponding to the prefetcher memory address.
- the prefetch data and the prefetch memory address corresponding to the prefetch data may be stored in the L1 cache (417).
- the LDST unit (413) may generate a request memory request to load data stored in the L1 cache (417) into the register file (411).
- the request memory address included in the request memory request may be compared with a prefetch memory address stored in the L1 cache (417). If the request memory address and the prefetch memory address match, a cache hit may occur.
- prefetch data may be transferred from the L1 cache (417) to the register file (411) through the LDST unit (413). If a cache hit occurs, the requested memory request may not be transferred to a lower cache of the L1 cache (417). If a cache miss occurs, the requested memory request may be transferred to the L2 cache (430), which is a lower cache of the L1 cache (417), and/or the global memory (440).
- a demand memory request occurs so that prefetch data can be loaded into the L1 cache (417) in advance.
- the demand memory request does not need to be transferred to a lower cache of the L1 cache (417), so that memory delay is reduced and high performance improvement can be obtained.
- the prefetcher (415) can predict a prefetch memory address, which is an address of prefetch data to be used for the next operation.
- the prefetcher (415) can generate a prefetch memory request including the prefetch memory address, and transmit the prefetch memory request to the L1 cache.
- a cache hit may occur because the prefetch data is already loaded into the L1 cache (417).
- the prefetch memory request may be deleted because a cache hit occurs.
- the LDST unit (413) can generate a request memory request to load data stored in the L1 cache into the register file (411).
- the request memory request is transmitted to the L1 cache (417)
- the request memory address included in the request memory request can be compared with a prefetch memory address stored in the L1 cache (417). If the request memory address and the prefetch memory address match, a cache hit can occur.
- prefetch data can be transferred from the L1 cache (417) to the register file (411) through the LDST unit (413).
- a GPU may be structured to execute thousands of threads simultaneously and share an L1 cache (417). Therefore, the size of the L1 cache (417) may be limited.
- the prefetch data stored in the L1 cache (417) can be eviction through steps 1 and 2. For example, before the required memory request reaches the L1 cache (417), the prefetch data can be eviction by a required memory request of another warp (or thread), and the data required by the other warp (or thread) can be written.
- the request memory request is generated, but it may be after the prefetch data has already been extracted. Therefore, even if the request memory request is delivered to the L1 cache (417), a cache miss may occur because the prefetch data has already been extracted. Therefore, the request memory request may be delivered to the L2 cache (430) or the global memory (440) through the interconnection (420).
- data can be transferred from the L2 cache (430) or global memory (440) to the register file (411) through the LDST unit (413).
- the prefetcher (415) predicts the prefetch memory address where the prefetch data required for the next operation is located, but the prediction may be incorrect. That is, the prefetch data may be loaded into the L1 cache (417) through steps 1 and 2 described in FIG. 4a, but if the prediction is incorrect, the prefetch data may unnecessarily occupy only the space of the L1 cache (417).
- step 3 the LDST unit (413) generates a memory request to load data stored in the L1 cache (417) into the register file (411), but a cache miss may occur due to an error in the prediction of the prefetch memory address.
- the steps after the cache miss occurs will be omitted as described above in Fig. 4c.
- FIG. 5 is a flow chart illustrating the operation of an electronic device including a preloader according to one embodiment of the present disclosure.
- the operations may be performed sequentially, but are not necessarily performed sequentially.
- the order of the operations may be changed, and at least two operations may be performed in parallel.
- Steps (501) to (509) may be performed by the processor, but the embodiment is not limited thereto, and may be performed by the preloader.
- the processor may sample previous requested memory addresses included in the previous requested memory request.
- the processor may sample previous request memory addresses included in previous request memory requests of the same warp. Alternatively, the processor may sample previous request memory addresses included in previous request memory requests of a different warp.
- the processor may generate a prefetch memory request based on the stride between sampled previous requested memory addresses.
- the processor can determine an intra-warp pattern stride based on a stride between previous requested memory addresses of the same warp.
- the processor can determine an inter-warp pattern stride based on a stride between previous requested memory addresses of different warps.
- the processor can predict a prefetch memory address where data required for a next operation is stored based on the intra-warp pattern stride and/or the inter-warp pattern stride.
- the prefetch memory request can include the predicted prefetch memory address.
- the stride may include both the intra-warp pattern stride and the inter-warp pattern stride.
- the priority of the intra-warp pattern stride may be higher than that of the inter-warp pattern stride. Therefore, if as a result of the processor determining the stride, the stride includes both the intra-warp pattern stride and the inter-warp pattern stride, and the intra-warp pattern stride and the inter-warp pattern stride are different, the processor may generate a prefetch memory request based on the intra-warp pattern stride.
- step (503) a prefetch memory response according to a prefetch memory request can be transmitted to the preloader.
- the processor can forward the prefetch memory request to a sub-cache of the preloader cache included in the preloader.
- the sub-cache of the preloader cache can be an L1 cache, an L2 cache, and a global memory. If prefetch data is stored in the sub-cache that received the prefetch memory request, a prefetch memory response can be generated.
- the processor can transmit the generated prefetch memory response to the preloader.
- the prefetch memory response can include the prefetch data. For example, if the prefetch data exists in the L2 cache, the prefetch memory response can be generated in the L2 cache.
- the prefetch memory response can be transmitted from the L2 cache to the preloader, and the prefetch memory response can include the prefetch data.
- the processor can store prefetch data included in the prefetch memory request and a prefetch memory address corresponding to the prefetch data in a preloader cache.
- the processor may store the prefetch memory address to check whether the prefetch memory address is correctly predicted when a demand memory request is received by the preloader.
- the demand memory request may include the demand memory address.
- the demand memory address may mean an address where data required by an instruction for the next operation is stored. Therefore, if the prefetch data is correctly loaded into the preloader cache, the prefetch memory address and the demand memory address may match.
- the processor may forward a request for memory for the next operation generated in the LDST unit to the preloader.
- the processor can check whether the requested memory address matches the prefetch memory address stored in the preloader cache.
- step (507) if the requested memory address does not match the prefetch memory address stored in the preloader cache, the processor may forward the requested memory request to a lower cache.
- the processor can forward the requested memory request to a sub-cache of the cache included in the preloader, where the sub-cache can include the L1 cache, the L2 cache, and the global memory.
- the processor can transfer data stored in the lower cache to the LDST unit.
- the processor may transmit a requested memory response to the LDST unit.
- the requested memory response may contain data corresponding to the requested memory address.
- the processor can transfer prefetch data stored in the preloader cache to the LDST unit in response to a demand memory request.
- data predicted to be needed for the next operation can be stored in the preloader cache rather than the L1 cache, thereby preventing data extraction as in Fig. 4c.
- FIG. 6 is a flow chart for explaining the operation of a GPU according to one embodiment of the present disclosure.
- the GPU (600) may include a streaming multiprocessor (610), an interconnection (620), an L2 cache (630), and a global memory (640).
- the streaming multiprocessor (610) may include a register file (611), an LDST unit (613), a preloader (615), and an L1 cache (617).
- the preloader (615) may include a cache (not shown), which is an internal storage device.
- the cache (not shown) included in the preloader (615) will be referred to as a preloader cache.
- the preloader (615) can sample previous request memory addresses included in a previous request memory request.
- the preloader (615) can determine a stride using the sampled previous request memory addresses.
- the preloader (615) can determine whether the stride is an inter-warp pattern stride and/or an intra-warp pattern stride using the sampled previous request memory addresses.
- the preloader (615) can predict a prefetch memory address, which is an address where data to be used for a next operation is stored, based on the determined stride. In other words, the preloader (615) can predict a request memory address to be included in a request memory request to be generated by the LDST unit.
- the preloader (615) may generate a prefetch memory request including a prefetch memory address.
- the prefetch memory request may be forwarded to the L1 cache (617). If prefetch data corresponding to the prefetch memory address exists in the L1 cache, a cache hit may occur. If a cache hit occurs, a prefetch memory response according to the prefetch memory request may be transmitted from the L1 cache (617) to the preloader (615). At this time, the prefetch memory response may include prefetch data.
- the preloader (615) may receive the prefetch memory response and store the prefetch data in the preloader cache.
- the prefetch memory request may be transmitted to a lower cache through the interconnection (620). If there is prefetch data corresponding to the prefetch memory address in the lower cache that received the prefetch memory request, a cache hit may occur and a prefetch memory response may be generated in the lower cache. At this time, the prefetch memory response may be transmitted to the preloader (615). The preloader (615) may store the prefetch data included in the prefetch memory response in the preloader cache.
- prefetch data may not exist in the L2 cache
- a cache miss occurs and a prefetch memory request may be forwarded to the global memory (640).
- a prefetch memory response may be generated.
- the generated prefetch memory response may be transmitted to the preloader (615).
- the LDST unit (613) may generate a demand memory request to load data required for the next operation into the register file (611).
- the demand memory request may include a demand memory address where the data required for the next operation is stored.
- the demand memory request can be forwarded to the preloader (615). If the prefetch data address of the prefetch data stored in the preloader cache is compared with the demand memory address of the demand memory request and they are the same, the prefetch data can be loaded into the register file (611) through the LDST unit (613).
- prefetch data can be loaded into the register file (611) even if the required memory request does not access the L1 cache (617) or lower caches. In other words, required data can be loaded into the register file (611) with minimal memory delay.
- FIGS. 7A to 7C are drawings for explaining the operation of a preloader according to one embodiment of the present disclosure.
- the preloader (720) may include a prefetch address generator (721) and a preloader cache (723).
- the preloader cache (723) may be an internal storage device of the preloader (720).
- the preloader (720) may be connected to the LDST unit (710). Accordingly, all required memory requests generated from the LDST unit (710) may pass through the preloader (720).
- Recent GPUs may utilize a sector L1 cache that divides a 128-byte sized cache line into four 32-byte sized sectors.
- the sector L1 cache may load data at the sector level instead of loading the entire 128-byte sized cache line.
- the L1 cache (730) may be a sector L1 cache.
- the preloader cache (723) may include one entry per warp to store the status of the entry, the prefetch memory address, and the prefetch data. Therefore, the preloader cache (723) may include a total of 64 entries. In other words, the preloader cache (723) may have a total of 64 rows.
- Each of the entries may be indexed by a warp ID. For example, the first entry may be indexed by warp #00, the second entry may be indexed by warp #01, and so on.
- Each of the entries may include 4 status bits indicating the status of the entry, 106 bits indicating the prefetch memory address, and 1024 bits indicating the prefetch data.
- the preloader (720) can generate multiple sub-prefetch memory requests to prefetch sector-sized data.
- a prefetch memory request consists of four sub-prefetch memory requests. Therefore, it will be apparent to those skilled in the art that the present disclosure is not limited to the case where there are four prefetch memory requests. In this case, each of the four sub-prefetch memory requests can access data of sectors located in four different cache lines.
- Figure 7a is a diagram for explaining a method of generating a prefetch memory request.
- 1 to 7 are numbers only for convenience of explanation and do not mean that the operations are performed sequentially.
- a prefetch memory request can be generated.
- the prefetch memory request includes a prefetch memory address and can be delivered to the L1 cache (730).
- the prefetch address generator (721) can generate up to four sub-prefetch memory requests for each warp.
- Each sub-prefetch memory request can be a request for one sector delivered to the L1 cache.
- the prefetch memory request can be composed of four sub-prefetch memory requests.
- Each of the sub-prefetch memory requests can include an address.
- the prefetch memory address can be composed of addresses included in the four sub-prefetch memory requests.
- the preloader (720) may store the prefetch memory address in the preloader cache (723). At this time, rather than storing the entire prefetch memory address, only a part of the addresses of the four sub-prefetch memory requests constituting the prefetch memory address may be stored.
- the offsets of the addresses included in the first sub-prefetch memory request and the addresses included in the other sub-prefetch memory requests can be stored.
- the offset is limited to 20 bits, but only 14 bits, excluding the least significant bit (LSB) 6 bits, can be stored as a sector offset.
- the prefetch memory address can be converted to 106 bits and stored in the preloader cache (723).
- the preloader (720) can use the warp ID as an index. Since the preloader (720) can generate one prefetch memory request for one warp, the preloader cache (723) can have 64 entries to store the state of the entry, the converted address, and the prefetch data. Since each of the entries is indexed by the warp ID, the preloader (720) can use the warp ID as an index to store the converted address.
- a status bit indicating the status of the entry may be updated.
- the status bit may be updated to indicate that a prefetch memory request has been generated. The method by which the status of the entry is updated will be further described in FIG. 8.
- Figure 7b is a diagram for explaining when a request for memory is transmitted from the LDST unit (710) to the preloader (720). 1 to 6 are numbers only for convenience of explanation and do not mean that the operations are performed sequentially.
- a demand memory request can be composed of four demand sub-memory requests. For convenience of explanation, it will be assumed below that a demand memory request is composed of four demand sub-memory requests. However, it will be apparent to those skilled in the art that the present disclosure is not limited to the case where there are four demand sub-memory requests.
- Each of the demand sub-memory requests can include a demand address.
- a demand memory request can include a demand memory address.
- the demand memory address can be composed of demand addresses of the demand sub-memory requests.
- the preloader (720) can select an entry from the preloader cache (723) using the warp ID.
- the demand memory request may be for the next operation of a specific warp. Therefore, the preloader (720) can select an entry from the preloader cache (723) using the warp ID of this specific warp.
- the offsets of the request sub-memory requests can be calculated in the same manner as the prefetch sub-memory address in Fig. 7a. That is, the offsets in the request addresses of the request sub-memory requests other than the first request sub-memory request are limited to 20 bits, but only 14 bits excluding the LSB 6 bits can be calculated as the offset.
- the converted address and the address combined in 3 can be compared. In other words, the prefetch memory address and the requested memory address can be compared.
- the request memory request can be transmitted to the L1 cache (730) based on the comparison result and the selected entry.
- the requested memory request may be deleted and not forwarded to the L1 cache (730).
- the comparison result addresses are the same and the status of the entry is such that a prefetch request has already been generated, this may mean that the prefetch memory address stored in the preloader cache (723) was accurately predicted.
- the prefetch data from the preloader cache (723) may be transferred to the LDST unit (710) through a writeback operation, and there may be no need to transfer the required memory request to the L1 cache (730).
- the write back operation is not performed and the required memory request may be transferred to the Ll cache (730).
- the status of the entry can be updated.
- the method by which the status of the entry is updated is described in Fig. 8.
- Figure 7c is a diagram illustrating a method for managing prefetch memory responses.
- a prefetch memory request is forwarded to a lower cache of the preloader cache (723), and in response, a prefetch memory response may be forwarded from the lower cache to the preloader (720).
- the prefetch memory response may include prefetch data.
- the prefetch data may be stored in the preloader cache (723) or bypassed to the LDST unit (710).
- the preloader (720) can use the warp ID to select an entry that has detailed information of a prefetch memory request.
- the preloader (720) can use the warp ID to select an entry indexed by the warp ID from the preloader cache (723).
- the prefetch memory response can be written back to the LDST unit using a demultiplexer. That is, if the requested memory request has already been generated, the prefetch data can be bypassed to the LDST unit without being stored in the preloader cache (723).
- the prefetch data included in the prefetch memory response may be stored in the preloader cache (723). At this time, the stored prefetch data may be transmitted to the LDST unit according to the method described in Fig. 7b when a requested memory request is generated by the LDST unit later.
- FIG. 8 is a diagram for explaining a status update of an entry according to one embodiment of the present disclosure.
- Each of the entries included in the preloader cache can have five states individually.
- the state of the entry can be expressed by a state bit.
- the state bit can include multiple bits.
- the lower two bits of the state bits can represent the state of the entry.
- the upper bits of the state bits excluding the lower two bits can be used to manage multiple sub-prefetch memory requests.
- the number of the upper bits excluding the lower two bits of the multiple bits can be based on the number of multiple sub-prefetch memory requests. In other words, when the number of upper bits excluding the lower two bits is N, 2 N sub-prefetch memory requests can be managed.
- the upper bits excluding the lower two bits can be updated according to the number of multiple sub-prefetch memory responses corresponding to the multiple sub-prefetch memory requests that have arrived at the preloader.
- the status bit is 4 bits.
- the lower 2 bits can indicate the status of the entry, and the upper 2 bits can be used to manage 2 2 sub-prefetch memory requests.
- the explanation below is not limited to the case where the status bit is 4 bits.
- the state of an entry can always start in the Invalid state, and in the Invalid state, the state bits can be represented as [0 0 0 0].
- the state of the entry can be updated from the Invalid state to the Pref. Gen. state.
- the Pref. Gen. state can be expressed as [0 0 0 1].
- the Pref. Gen. state may be a state indicating that a prefetch memory request has been generated.
- the state of an entry can be updated to one of three states from Pref. Gen. state.
- the state of the entry can be updated from Pref. Gen. state to Dem. Gen. state.
- the Dem. Gen. state can be expressed as [# # 1 1].
- the upper two bits can be updated according to the number of sub-prefetch memory responses corresponding to the sub-prefetch memory requests. For example, if only two demand sub-memory responses arrive at the preloader in response to four demand sub-memory requests, the upper two bits can be represented as [1 0].
- the state of the entry can be updated from the Pref. Gen. state to the Miss Match state.
- the Miss Match state can be expressed as [# # 1 0].
- the state of the entry can be updated from the Pref. Gen. state to the Pre. Data Ack. state.
- the Pre. Data Ack. state can be expressed as [# # 0 1].
- the upper two bits of the Dem. Gen. status, Miss Match status, and Pre. Data Ack. status may indicate the number of sub-prefetch memory responses that arrived at the preloader in response to multiple sub-prefetch memory requests.
- a Miss Match condition may indicate that the prefetch memory address and the requested memory address do not match.
- the state of the entry can be updated from the Miss Match state to the Invalid state again.
- the required memory request in the Miss Match state can be forwarded to the lower cache to load the data.
- the Dem. Gen. state can indicate a state where the prefetch memory address matches the requested memory address. At this time, the requested memory address can be removed so as not to be delivered to the L1 cache.
- the status of the entry can be updated from the Dem. Gen. status to the Invalid status.
- Pre. Data Ack. state can indicate that a sub-prefetch memory response has arrived at the preloader for a sub-prefetch memory request before the requested memory request is generated. Accordingly, data loaded into the preloader can be stored in the preloader cache (i.e., entry).
- the prefetch data stored in the preloader cache can be transferred to the LDST unit. Then, the state of the entry can be updated from the Pre. Data Ack. state to the Dem. Gen. state.
- the state of the entry can be updated from the Pre. Data Ack. state to the Miss Match state. Then, the requested memory request can be propagated to the lower cache.
- FIG. 9 is a flowchart for explaining the operation of an electronic device according to one embodiment of the present disclosure.
- the operations may be performed sequentially, but are not necessarily performed sequentially.
- the order of the operations may be changed, and at least two operations may be performed in parallel.
- Steps (901) to (907) may be performed by the processor, but the embodiment is not limited thereto, and may be performed by the preloader.
- the processor may generate a prefetch memory request based on the stride of sampled previous requested memory addresses.
- the processor may store prefetch data included in a prefetch memory response, which is a response to a prefetch memory request, and a prefetch memory address corresponding to the prefetch data in a preloader cache.
- the processor can determine whether a request memory address included in a request memory request for the next operation generated from the LDST unit and a prefetch memory address stored in the preloader cache match.
- the processor may transmit prefetch data to the LDST unit if the requested memory address and the prefetch memory address match, and may forward the requested memory request to a lower cache of the preloader cache if the requested memory address and the prefetch memory address do not match.
- the method according to the present invention can be written as a program that can be executed on a computer and can be implemented in various recording media such as a magnetic storage medium, an optical reading medium, and a digital storage medium.
- the implementations of the various technologies described herein may be implemented as digital electronic circuitry, or as computer hardware, firmware, software, or combinations thereof.
- the implementations may be implemented as a computer program product, i.e., a computer program tangibly embodied in an information carrier, e.g., a machine-readable storage medium (computer-readable medium) or a radio signal, for processing by the operation of a data processing device, e.g., a programmable processor, a computer, or multiple computers, or for controlling the operation thereof.
- a computer program such as the computer program(s) described above, may be written in any form of programming language, including compiled or interpreted languages, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
- the computer program may be deployed to be processed on one computer or multiple computers at one site, or distributed across multiple sites and interconnected by a communications network.
- processors suitable for processing a computer program include, for example, both general-purpose and special-purpose microprocessors, and any one or more processors of any type of digital computer.
- the processor will receive instructions and data from a read-only memory or a random access memory or both.
- Elements of the computer may include at least one processor for executing instructions and one or more memory devices for storing instructions and data.
- the computer may include, or be coupled to receive data from, transmit data to, or both, one or more mass storage devices for storing data, such as magnetic, magneto-optical disks, or optical disks.
- Information carriers suitable for embodying computer program instructions and data include, by way of example, semiconductor memory devices, magnetic media such as hard disks, floppy disks, and magnetic tape, optical media such as CD-ROMs (Compact Disk Read Only Memory) and DVDs (Digital Video Disk), magneto-optical media such as floptical disks, ROMs (Read Only Memory), RAMs (Random Access Memory), flash memory, EPROMs (Erasable Programmable ROM), EEPROMs (Electrically Erasable Programmable ROM), etc.
- the processor and memory may be supplemented by, or included in, special purpose logic circuitry.
- the computer-readable medium can be any available medium that can be accessed by a computer, and can include both computer storage media and transmission media.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
메모리 주소를 예측하여 데이터를 프리패칭하는 전자 장치 및 그 동작 방법이 도시된다.An electronic device and method of operating the same for prefetching data by predicting a memory address are described.
본 출원은 2023년도 정부(과학기술정보통신부)의 재원으로 정보통신기획평가원의 지원을 받아 수행된 연구 결과이다(과제번호: RS-2022-00155966, 과제명: 인공지능융합혁신인재양성(이화여자대학교)(Artificial Intelligence Convergence Innovation Human Resources Development (Ewha Womans University)), 국가과제고유번호: 1711179344).This application is the result of a study conducted with the support of the National IT Industry Promotion Agency (NIPA) with funding from the government (Ministry of Science and ICT) in 2023 (Project No.: RS-2022-00155966, Project Name: Artificial Intelligence Convergence Innovation Human Resources Development (Ewha Womans University), National Project Unique Number: 1711179344).
또한, 본 출원은 2023년도 정부(과학기술정보통신부)의 재원으로 정보통신기획평가원의 지원을 받아 수행된 연구 결과이다(과제번호: 2021-0-02068, 과제명: 인공지능 혁신 허브 연구 개발(Artificial Intelligence Innovation Hub), 국가과제고유번호: 1711193622).In addition, this application is the result of research conducted with the support of the Information and Communication Planning and Evaluation Institute with funding from the government (Ministry of Science and ICT) in 2023 (Project No.: 2021-0-02068, Project Name: Artificial Intelligence Innovation Hub Research and Development, National Project Unique Number: 1711193622).
또한, 본 출원은 2023년도 정부(과학기술정보통신부)의 재원으로 한국연구재단의 지원을 받아 수행된 연구 결과이다(과제번호: 2021R1G1A1092196, 과제명: 대규모 병렬 프로세서를 위한 미세 전력 관리 기법, 국가과제고유번호: 1711189100).In addition, this application is the result of research conducted with the support of the National Research Foundation of Korea with funding from the government (Ministry of Science and ICT) in 2023 (Project Number: 2021R1G1A1092196, Project Name: Fine Power Management Techniques for Massively Parallel Processors, National Project Unique Number: 1711189100).
프로세서는 머신 러닝 및 블록 체인과 같은 애플리케이션을 실행할 수 있다. 프로세서에서 애플리케이션을 실행할 때 하나의 명령어에 의해 연산이 종료된 후 다음 명령어에 의한 연산이 실행되어 파이프라인 스톨(pipeline stall)이 발생할 수 있다. 파이프라인 스톨이 감소할수록 프로세서는 더 높은 성능을 발휘할 수 있다. 따라서, 이러한 파이프라인 스톨을 줄이기 연구가 활발히 수행되고 있다.The processor can execute applications such as machine learning and blockchain. When executing an application on the processor, a pipeline stall may occur because the operation by the next instruction is executed after the operation by one instruction is completed. The processor can perform better as the pipeline stall is reduced. Therefore, research is actively being conducted to reduce this pipeline stall.
본 개시는 연산에 이용된 메모리 주소를 이용하여 다음 연산에 필요한 메모리를 프리로더 캐시에 미리 로딩함으로써 파이프라인 스톨을 줄일 수 있다.The present disclosure can reduce pipeline stalls by preloading memory required for the next operation into a preloader cache using the memory address used in the operation.
본 개시는 프리로더 캐시에 다음 연산에 필요한 메모리를 프리패치함으로써 데이터가 L1 캐시에서 적출되더라도 다시 데이터를 L1 캐시로 로딩할 필요가 없어 파이프라인 스톨을 줄일 수 있다.The present disclosure can reduce pipeline stalls by prefetching memory required for the next operation into the preloader cache, thereby eliminating the need to load data into the L1 cache again even if the data is fetched from the L1 cache.
본 개시의 일 실시예에 따른 전자 장치의 동작 방법은 이전 요구 메모리 요청(prior demand memory request)에 포함된 이전 요구 메모리 주소들(prior demand memory address)을 샘플링하는 단계, 상기 샘플링된 상기 이전 요구 메모리 주소들 간의 보폭(stride)에 기반하여 프리패치 메모리 요청(prefetch memory request)을 생성하는 단계, 상기 프리패치 메모리 요청에 따른 프리패치 메모리 응답(prefetch response)을 프리로더에 전달하는 단계, 및 상기 프리패치 메모리 응답에 포함되는 프리패치 데이터 및 상기 프리패치 데이터에 대응하는 프리패치 메모리 주소(prefetch memory address)를 프리로더 캐시(preloader cache)에 저장하는 단계를 포함할 수 있다.An operating method of an electronic device according to one embodiment of the present disclosure may include the steps of sampling prior demand memory addresses included in a prior demand memory request, generating a prefetch memory request based on a stride between the sampled prior demand memory addresses, transmitting a prefetch memory response according to the prefetch memory request to a preloader, and storing prefetch data included in the prefetch memory response and a prefetch memory address corresponding to the prefetch data in a preloader cache.
상기 프리패치 메모리 요청을 생성하는 단계는, 상기 보폭에 기반하여 상기 프리패치 메모리 주소를 예측하고, 상기 프리패치 메모리 주소를 포함하는 상기 프리패치 메모리 요청을 생성할 수 있다.The step of generating the above prefetch memory request can predict the prefetch memory address based on the step, and generate the prefetch memory request including the prefetch memory address.
상기 보폭은, 인트라 워프 패턴 보폭(intra-warp pattern stride) 및 인터 워프 패턴 보폭(inter-warp pattern stride) 중 하나 또는 둘 이상의 조합을 포함하고, 상기 프리패치 메모리 요청을 생성하는 단계는, 상기 인트라 워프 패턴 보폭의 우선 순위를 상기 인터 워프 패턴 보폭 보다 높게 결정하여 상기 프리패치 메모리 요청을 결정할 수 있다.The stride includes one or a combination of two or more of an intra-warp pattern stride and an inter-warp pattern stride, and the step of generating the prefetch memory request can determine the prefetch memory request by determining a priority of the intra-warp pattern stride higher than that of the inter-warp pattern stride.
상기 프리패치 메모리 요청을 생성하는 단계는, 상기 보폭이 인트라 워프 패턴 및 인터 워프 패턴 보폭을 모두 포함하고 상기 인트라 워프 패턴 보폭 및 상기 인터 워프 패턴 보폭 각각에 기반한 상기 프리패치 메모리 주소가 상이한 경우, 상기 인트라 워프 패턴 보폭에 기반한 상기 프리패치 메모리 요청을 생성할 수 있다.The step of generating the above prefetch memory request may include generating the prefetch memory request based on the intra-warp pattern stride when the stride includes both an intra-warp pattern stride and an inter-warp pattern stride and the prefetch memory addresses based on each of the intra-warp pattern stride and the inter-warp pattern stride are different.
LDST 유닛(load/store unit)으로부터 다음 연산을 위한 요구 메모리 요청(demand memory request)을 상기 프리로더로 전달하는 단계, 및 상기 요구 메모리 요청에 포함된 요구 메모리 주소(demand memory address) 및 상기 프리패치 메모리 주소에 기반하여 상기 다음 연산에 필요한 데이터를 상기 LDST 유닛에 전송하는 단계를 더 포함할 수 있다.The method may further include a step of transmitting a demand memory request for a next operation from a load/store unit (LDST unit) to the preloader, and a step of transmitting data required for the next operation to the LDST unit based on a demand memory address included in the demand memory request and the prefetch memory address.
상기 다음 연산에 필요한 데이터를 상기 LDST 유닛에 전송하는 단계는, 상기 요구 메모리 주소와 상기 프리패치 메모리 주소가 일치하는 경우, 상기 프리패치 메모리 주소에 대응하는 상기 프리패치 데이터를 상기 프리로더 캐시로부터 상기 LDST 유닛으로 전송할 수 있다.The step of transmitting data required for the above-described next operation to the LDST unit may include transmitting the prefetch data corresponding to the prefetch memory address from the preloader cache to the LDST unit when the requested memory address and the prefetch memory address match.
상기 다음 연산에 필요한 데이터를 상기 LDST 유닛에 전송하는 단계는, 상기 요구 메모리 주소와 상기 프리패치 메모리 주소가 상이한 경우, 상기 요구 메모리 요청을 하위 캐시로 전달하고, 상기 요구 메모리 요청을 수신한 상기 하위 캐시로부터 상기 데이터를 상기 LDST 유닛으로 전송할 수 있다.The step of transmitting data required for the above-described next operation to the LDST unit may include, when the requested memory address and the prefetch memory address are different, transmitting the requested memory request to a lower cache, and transmitting the data from the lower cache that received the requested memory request to the LDST unit.
상기 프리로더 캐시는, 복수의 엔트리들을 포함하고, 상기 복수의 엔트리들 각각은 엔트리의 상태를 나타내는 상태 비트를 포함할 수 있다.The above preloader cache may include a plurality of entries, and each of the plurality of entries may include a status bit indicating a status of the entry.
상기 프리패치 메모리 요청이 생성되었는지 여부, 요구 메모리 요청이 생성되기 전에 상기 프리패치 메모리 응답이 프리로더에 도달했는지 여부, 및 요구 메모리 주소와 상기 프리패치 메모리 주소가 일치하는 여부에 따라 상기 상태 비트들을 업데이트하는 단계를 더 포함할 수 있다. The method may further include updating the status bits depending on whether the prefetch memory request has been generated, whether the prefetch memory response has reached the preloader before the requested memory request is generated, and whether the requested memory address and the prefetch memory address match.
상기 프리로더 캐시에 저장하는 단계는, 복수의 서브 프리패치 메모리 요청들(sub-prefetch memory requests)을 생성하고, 상기 복수의 서브 프리패치 메모리 요청들에 기반하여 상기 프리패치 메모리 주소를 저장할 수 있다.The step of storing in the above preloader cache may generate a plurality of sub-prefetch memory requests and store the prefetch memory address based on the plurality of sub-prefetch memory requests.
본 개시의 일 실시예에 따른, 전자 장치의 동작 방법은 샘플링된 이전 요구 메모리 주소들의 보폭에 기반하여 프리패치 메모리 요청을 생성하는 단계, 상기 프리패치 메모리 요청에 대한 응답인 프리패치 메모리 응답에 포함되는 프리패치 데이터 및 상기 프리패치 데이터에 대응하는 프리패치 메모리 주소(prefetch memory address)를 프리로더 캐시에 저장하는 단계, LDST 유닛으로부터 생성된 다음 연산을 위한 요구 메모리 요청에 포함된 요구 메모리 주소 및 상기 프리로더 캐시에 저장된 상기 프리패치 메모리 주소가 일치하는지 여부를 판단하는 단계, 및 상기 요구 메모리 주소와 상기 프리패치 메모리 주소가 일치하는 경우, 상기 프리패치 데이터를 상기 LDST 유닛으로 전송하고, 상기 요구 메모리 주소와 상기 프리패치 메모리 주소가 일치하지 않는 경우, 상기 요구 메모리 요청을 상기 프리로더 캐시의 하위 캐시로 전달하는 단계를 포함할 수 있다.According to one embodiment of the present disclosure, a method of operating an electronic device may include the steps of generating a prefetch memory request based on a stride of sampled previous request memory addresses, storing prefetch data included in a prefetch memory response which is a response to the prefetch memory request and a prefetch memory address corresponding to the prefetch data in a preloader cache, determining whether a request memory address included in a request memory request for a next operation generated from an LDST unit and the prefetch memory address stored in the preloader cache match, and if the request memory address and the prefetch memory address match, transmitting the prefetch data to the LDST unit, and if the request memory address and the prefetch memory address do not match, forwarding the request memory request to a lower cache of the preloader cache.
본 발명의 일 실시예에 따른 전자 장치는, 이전 요구 메모리 요청(prior demand memory request)에 포함된 이전 요구 메모리 주소들(prior demand memory address)을 샘플링하고, 상기 샘플링된 상기 이전 요구 메모리 주소들 간의 보폭(stride)에 기반하여 프리패치 메모리 요청(prefetch memory request)을 생성하고, 상기 프리패치 메모리 요청에 따른 프리패치 메모리 응답(prefetch response)을 프리로더에 전달하고, 상기 프리패치 메모리 응답에 포함되는 프리패치 데이터 및 상기 프리패치 데이터에 대응하는 프리패치 메모리 주소(prefetch memory address)를 프리로더 캐시에 저장하는 프로세서를 포함하고, 상기 프로세서는, 상기 프리패치 메모리 요청을 생성하는 상기 프리로더를 포함하고, 상기 프리로더는, 상기 프리패치 메모리 주소 및 상기 프리 패치 데이터를 저장하는 상기 프리로더 캐시를 포함할 수 있다.An electronic device according to one embodiment of the present invention includes a processor configured to sample prior demand memory addresses included in a prior demand memory request, generate a prefetch memory request based on a stride between the sampled prior demand memory addresses, transmit a prefetch memory response according to the prefetch memory request to a preloader, and store prefetch data included in the prefetch memory response and a prefetch memory address corresponding to the prefetch data in a preloader cache, wherein the processor includes the preloader that generates the prefetch memory request, and the preloader may include the preloader cache that stores the prefetch memory address and the prefetch data.
상기 프로세서는, 상기 보폭에 기반하여 상기 프리패치 메모리 주소를 예측하고, 상기 프리패치 메모리 주소를 포함하는 상기 프리패치 메모리 요청을 생성할 수 있다.The processor can predict the prefetch memory address based on the stride and generate the prefetch memory request including the prefetch memory address.
상기 보폭은, 인트라 워프 패턴 보폭 및 인터 워프 패턴 보폭 중 하나 또는 둘 이상의 조합을 포함하고, 상기 프로세서는, 상기 인트라 워프 패턴 보폭의 우선 순위를 상기 인터 워프 패턴 보폭 보다 높게 결정하여 상기 프리패치 메모리 요청을 결정할 수 있다.The above stride includes one or a combination of two or more of an intra-warp pattern stride and an inter-warp pattern stride, and the processor can determine the prefetch memory request by determining a priority of the intra-warp pattern stride higher than that of the inter-warp pattern stride.
상기 프로세서는, 상기 보폭이 인트라 워프 패턴 보폭 및 인터 워프 패턴 보폭을 모두 포함하고 상기 인트라 워프 패턴 보폭 및 상기 인터 워프 패턴 보폭 각각에 기반한 상기 프리패치 메모리 주소가 상이한 경우, 상기 인트라 워프 패턴 보폭에 기반한 상기 프리패치 메모리 요청을 생성할 수 있다.The processor may generate the prefetch memory request based on the intra-warp pattern stride, when the stride includes both an intra-warp pattern stride and an inter-warp pattern stride, and the prefetch memory addresses based on each of the intra-warp pattern stride and the inter-warp pattern stride are different.
상기 프로세서는, LDST 유닛으로부터 다음 연산을 위한 요구 메모리 요청(demand memory request)을 상기 프리로더로 전달하고, 상기 요구 메모리 요청에 포함된 요구 메모리 주소(demand memory address) 및 상기 프리패치 메모리 주소에 기반하여 상기 다음 연산에 필요한 데이터를 상기 LDST 유닛에 전송할 수 있다.The above processor can transmit a demand memory request for the next operation from the LDST unit to the preloader, and transmit data required for the next operation to the LDST unit based on a demand memory address included in the demand memory request and the prefetch memory address.
상기 프로세서는, 상기 요구 메모리 주소와 상기 프리패치 메모리 주소가 일치하는 경우, 상기 프리패치 메모리 주소에 대응하는 상기 프리패치 데이터를 상기 프리로더 캐시로부터 상기 LDST 유닛으로 전송할 수 있다.The processor can transmit the prefetch data corresponding to the prefetch memory address from the preloader cache to the LDST unit when the requested memory address and the prefetch memory address match.
상기 프로세서는, 상기 요구 메모리 주소와 상기 프리패치 메모리 주소가 상이한 경우, 상기 요구 메모리 요청을 하위 캐시로 전달하고, 상기 요구 메모리 요청을 수신한 상기 하위 캐시로부터 상기 데이터를 상기 LDST 유닛으로 전송할 수 있다.The processor can, if the requested memory address and the prefetch memory address are different, transfer the requested memory request to a lower cache and transmit the data from the lower cache that received the requested memory request to the LDST unit.
상기 프리로더 캐시는, 상기 프리로더 캐시에 포함되는 엔트리들의 상태를 나타내는 상태 비트를 포함할 수 있다.The above preloader cache may include status bits indicating the status of entries included in the preloader cache.
상기 프로세서는, 복수의 서브 프리패치 메모리 요청들(sub-prefetch memory requests)을 생성하고, 상기 복수의 서브 프리패치 메모리 요청들을 병합하여 상기 프리패치 메모리 주소를 생성할 수 있다.The processor can generate a plurality of sub-prefetch memory requests and merge the plurality of sub-prefetch memory requests to generate the prefetch memory address.
본 개시의 일 실시예에 따르면, 다음 연산에 필요한 메모리를 프리로더 캐시에 미리 로딩함으로써 파이프라인 스톨을 줄일 수 있다.According to one embodiment of the present disclosure, pipeline stalls can be reduced by preloading memory required for the next operation into a preloader cache.
본 개시의 일 실시예에 따르면, 프리로더 캐시에 다음 연산에 필요한 메모리를 프리패치함으로써 데이터가 L1 캐시에서 적출되더라도 다시 데이터를 L1 캐시로 로딩할 필요가 없다.According to one embodiment of the present disclosure, by prefetching memory required for the next operation into the preloader cache, even if data is fetched from the L1 cache, there is no need to load the data into the L1 cache again.
도 1은 본 개시의 일 실시예에 따른 전자 장치를 도시한 도면이다.FIG. 1 is a diagram illustrating an electronic device according to one embodiment of the present disclosure.
도 2는 본 개시의 일 실시예에 따른 GPU를 설명하기 위한 도면이다.FIG. 2 is a diagram illustrating a GPU according to one embodiment of the present disclosure.
도 3a 및 도 3b는 보폭을 설명하기 위한 도면이다.Figures 3a and 3b are drawings for explaining the stride.
도 4a 내지 도 4d는 복수의 프리패칭 시나리오를 설명하기 위한 도면이다.Figures 4a to 4d are diagrams for explaining multiple prefetching scenarios.
도 5는 본 개시의 일 실시예에 따른 프리로더를 포함하는 전자 장치의 동작을 설명하기 위한 플로우 차트이다.FIG. 5 is a flow chart illustrating the operation of an electronic device including a preloader according to one embodiment of the present disclosure.
도 6은 본 개시의 일 실시예에 따른 GPU의 동작을 설명하기 위한 플로우 차트이다.FIG. 6 is a flow chart for explaining the operation of a GPU according to one embodiment of the present disclosure.
도 7a 내지 도 7c는 본 개시의 일 실시예에 따른 프리로더의 동작을 설명하기 위한 도면이다.FIGS. 7A to 7C are drawings for explaining the operation of a preloader according to one embodiment of the present disclosure.
도 8은 본 개시의 일 실시예에 따른 엔트리의 상태 업데이트를 설명하기 위한 도면이다.FIG. 8 is a diagram for explaining a status update of an entry according to one embodiment of the present disclosure.
도 9는 본 개시의 일 실시예에 따른 전자 장치의 동작을 설명하기 위한 플로우차트이다.FIG. 9 is a flowchart for explaining the operation of an electronic device according to one embodiment of the present disclosure.
이하, 실시예들을 첨부된 도면을 참조하여 상세하게 설명한다. 그러나, 특허출원의 범위가 이러한 실시예들에 의해 제한되거나 한정되는 것은 아니다. 각 도면에 제시된 동일한 참조 부호는 동일한 부재를 나타낸다.Hereinafter, embodiments will be described in detail with reference to the attached drawings. However, the scope of the patent application is not limited or restricted by these embodiments. The same reference numerals presented in each drawing represent the same components.
아래 설명하는 실시예들에는 다양한 변경이 가해질 수 있다. 아래 설명하는 실시예들은 실시 형태에 대해 한정하려는 것이 아니며, 이들에 대한 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.The embodiments described below may be modified in various ways. The embodiments described below are not intended to be limiting in terms of the embodiments, and should be understood to include all modifications, equivalents, or alternatives thereto.
제1 또는 제2 등의 용어는 다양한 구성 요소들을 설명하는데 사용될 수 있지만, 이런 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 이해되어야 한다. 예를 들어, 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소는 제1 구성요소로도 명명될 수 있다.Although the terms first or second may be used to describe various components, these terms should be understood only for the purpose of distinguishing one component from another. For example, a first component may be referred to as a second component, and similarly, a second component may also be referred to as a first component.
실시예에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 실시예를 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수 개의 표현을 포함한다. 본 명세서에서, "A 또는 B", "A 및 B 중 적어도 하나", "A 또는 B 중 적어도 하나", "A, B 또는 C", "A, B 및 C 중 적어도 하나", 및 "A, B, 또는 C 중 적어도 하나"와 같은 문구들 각각은 그 문구들 중 해당하는 문구에 함께 나열된 항목들 중 어느 하나, 또는 그들의 모든 가능한 조합을 포함할 수 있다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 명세서 상에 기재된 특징, 숫자, 단계, 동작, 구성 요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used in the examples is only used to describe specific embodiments and is not intended to be limiting of the embodiments. The singular expression includes the plural expression unless the context clearly indicates otherwise. In this specification, each of the phrases such as "A or B", "at least one of A and B", "at least one of A or B", "A, B or C", "at least one of A, B and C", and "at least one of A, B, or C" can include any one of the items listed together in the corresponding phrase among the phrases, or all possible combinations thereof. It should be understood that the terms "comprises" or "has" in this specification specify that a feature, number, step, operation, component, part or combination thereof described in the specification is present, but do not exclude in advance the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts or combinations thereof.
다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 실시예가 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiment belongs. Terms defined in commonly used dictionaries, such as those defined in common usage dictionaries, should be interpreted as having a meaning consistent with the meaning they have in the context of the relevant art, and will not be interpreted in an idealized or overly formal sense unless expressly defined in this application.
또한, 첨부 도면을 참조하여 설명함에 있어, 도면 부호에 관계없이 동일한 구성 요소는 동일한 참조 부호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 실시예를 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 실시예의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다.In addition, when describing with reference to the attached drawings, the same components will be given the same reference numerals regardless of the drawing numbers, and redundant descriptions thereof will be omitted. When describing an embodiment, if it is determined that a specific description of a related known technology may unnecessarily obscure the gist of the embodiment, the detailed description thereof will be omitted.
이하, 본 발명의 실시예를 첨부된 도면을 참조하여 상세하게 설명한다. Hereinafter, embodiments of the present invention will be described in detail with reference to the attached drawings.
도 1은 본 개시의 일 실시예에 따른 전자 장치를 도시한 도면이다. FIG. 1 is a diagram illustrating an electronic device according to one embodiment of the present disclosure.
도 1을 참조하면 전자 장치(100)가 도시된다. 전자 장치(100)는 프로세서(110)를 포함할 수 있다. 도 1에 도시된 전자 장치(100)에는 본 개시의 실시예들과 관련된 구성 요소들만이 도시되어 있다. 따라서, 전자 장치(100)는 도 5에 도시된 구성 요소 외에 다른 범용적인 구성 요소들을 더 포함할 수 있음은 통상의 기술자에게 자명하다.Referring to FIG. 1, an electronic device (100) is illustrated. The electronic device (100) may include a processor (110). Only components related to embodiments of the present disclosure are illustrated in the electronic device (100) illustrated in FIG. 1. Accordingly, it is apparent to a person skilled in the art that the electronic device (100) may further include other general components in addition to the components illustrated in FIG. 5.
프로세서(110)는 전자 장치(100)를 제어하기 위한 전반적인 기능을 수행하는 역할을 수행할 수 있다. 프로세서(110)는 메모리(미도시)에 저장된 프로그램들 및/또는 명령어들을 실행함으로써, 전자 장치(100)를 전반적으로 제어할 수 있다. 프로세서(110)는 전자 장치(100) 내에 구비된 CPU(central processing unit), GPU(graphics processing unit), TPU(tensor processing unit) 및 NPU(neural processing unit) 등으로 구현될 수 있으나, 이에 제한되지 않는다.The processor (110) may perform a role of performing overall functions for controlling the electronic device (100). The processor (110) may control the electronic device (100) overall by executing programs and/or commands stored in a memory (not shown). The processor (110) may be implemented as a central processing unit (CPU), a graphics processing unit (GPU), a tensor processing unit (TPU), and a neural processing unit (NPU) provided in the electronic device (100), but is not limited thereto.
프로세서(110)는 프리로더(preloader)(111)를 포함할 수 있다. 프리로더(111)는 캐시(미도시)를 포함할 수 있다. 프리로더(111)는 프리패처의 일종이지만, 캐시(미도시)를 포함하지 않는 프리패처와 구별하기 위해 프리로더(111)라고 하겠다. 프리로더(111)에 포함되는 캐시(미도시)를 프리로더 캐시라고 할 수 있다. 프리로더(111)는 이전 연산에서 이미 생성된 메모리 주소를 사용하여 보폭(stride)을 계산할 수 있다. 프리로더(111)는 이 보폭을 이용하여 다음 메모리 주소를 예측할 수 있다. 프리로더(111)는 예측한 다음 메모리 주소에 저장된 데이터를 프리로더 캐시로 미리 로딩하는 프리패치 메모리 요청을 생성할 수 있다.The processor (110) may include a preloader (111). The preloader (111) may include a cache (not shown). The preloader (111) is a type of prefetcher, but will be referred to as a preloader (111) to distinguish it from a prefetcher that does not include a cache (not shown). The cache (not shown) included in the preloader (111) may be referred to as a preloader cache. The preloader (111) may calculate a stride using a memory address already generated in a previous operation. The preloader (111) may predict a next memory address using this stride. The preloader (111) may generate a prefetch memory request to preload data stored in the predicted next memory address into the preloader cache.
이하에서는, 설명의 편의를 위해 프로세서(110)의 예시 중 하나인 GPU를 이용하여 본 개시를 설명하도록 하겠다. 다만, 이하의 설명이 GPU뿐만 아니라 프리로더를 포함하는 경우, CPU, TPU 및 NPU에도 적용될 수 있음은 통상의 기술자에게 자명하다.Hereinafter, for convenience of explanation, the present disclosure will be explained using a GPU, which is an example of a processor (110). However, it is obvious to those skilled in the art that the following explanation can be applied not only to a GPU but also to a CPU, TPU, and NPU when a preloader is included.
도 2는 본 개시의 일 실시예에 따른 GPU를 설명하기 위한 도면이다.FIG. 2 is a diagram illustrating a GPU according to one embodiment of the present disclosure.
도 2를 참조하면, 본 개시의 실시예에 따른 GPU(200)가 도시된다. GPU(200)는 쓰레드 블록 스케줄러(thread block scheduler), 복수의 스트리밍 멀티 프로세서들(streaming multiprocessor)(210-1, 210-2, 210-N), 인터커넥션(inter connection), 공유 L2 캐시(shared L2 cache)(220) 및 글로벌 메모리(global memory)(230)를 포함할 수 있다.Referring to FIG. 2, a GPU (200) according to an embodiment of the present disclosure is illustrated. The GPU (200) may include a thread block scheduler, a plurality of streaming multiprocessors (210-1, 210-2, 210-N), an inter connection, a shared L2 cache (220), and a global memory (230).
복수의 스트리밍 멀티프로세서들(210-1, 210-2, 210-N)(이하, SM) 각각은 동시에 수천개의 쓰레드들(threads)을 실행할 수 있다. 각 SM은 스트리밍 프로세서(streaming processor, 이하 SP)(213)라고 불리는 수 백 개의 코어들을 포함할 수 있다. SP(213) 산술 연산(arithmetic operation)을 수행할 수 있다. SM들에 스케줄링된 쓰레드들은 복수의 워프들(warps)로 나누어질 수 있다. 복수의 워프들은 워프 스케줄러(211)에 의해 다양한 스케줄링 정책(scheduling policy)에 의해 SP(213)들에 스케줄링될 수 있다.Each of a plurality of streaming multiprocessors (210-1, 210-2, 210-N) (hereinafter, SM) can execute thousands of threads simultaneously. Each SM can include hundreds of cores called streaming processors (hereinafter, SPs) (213). The SPs (213) can perform arithmetic operations. Threads scheduled to the SMs can be divided into a plurality of warps. The plurality of warps can be scheduled to the SPs (213) by a warp scheduler (211) according to various scheduling policies.
GPU(200)는 CPU와 유사한 메모리 계층(memory hierarchy)을 가질 수 있다. SM은 큰 크기의 레지스터 파일(register file)(212)을 포함할 수 있다. SM은 레지스터 파일(212)의 하위 계층으로 L1 캐시(216) 및 스크래치패드 메모리(scratchpad memory)(217)를 포함할 수 있다. 마지막으로, GPU(200)는 스케줄링된 모든 쓰레드들에 의해 공유되는 공유 L2 캐시(220) 및 글로벌 메모리(230)를 포함할 수 있다. The GPU (200) may have a memory hierarchy similar to that of the CPU. The SM may include a large-sized register file (212). The SM may include an L1 cache (216) and a scratchpad memory (217) as lower layers of the register file (212). Finally, the GPU (200) may include a shared L2 cache (220) and a global memory (230) shared by all scheduled threads.
데이터가 명령어에 의해 사용되기 위해서는 레지스터 파일(212)에 로딩되어야 할 수 있다. 따라서, 데이터를 레지스터 파일(212)의 직전 하위 캐시에 미리 로딩하는 프리패칭(prefetching)을 통해 메모리 지연을 줄일 수 있다. Data may need to be loaded into the register file (212) in order to be used by an instruction. Therefore, memory latency can be reduced through prefetching, which loads data in advance into the immediate lower cache of the register file (212).
SM은 프리로더(preloader)(215)를 포함할 수 있다. 프리로더(215)는 프리패치를 수행할 수 있다. 프리로더(215)는 프리패치를 수행하는 프리패처(prefetcher)의 일종일 수 있다. 다만, 프리로더(215)는 내부에 프리패치 메모리 주소 및 프리패치 데이터를 저장하는 프리로더 캐시를 더 포함할 수 있다. The SM may include a preloader (215). The preloader (215) may perform prefetching. The preloader (215) may be a type of prefetcher that performs prefetching. However, the preloader (215) may further include a preloader cache that stores a prefetch memory address and prefetch data therein.
프리로더(215)는 하위 캐시인 L1 캐시(216), 공유 L2 캐시(220) 또는 글로벌 메모리(230)로부터 데이터를 프리패치(prefetch)할 수 있다. 이하에서, L1 캐시(216), 공유 L2 캐시(220) 또는 글로벌 메모리(230)로부터 프리패치되는 데이터를 프리패치 데이터(prefetch data)라고 하겠다. 또한, 프리패치 데이터가 저장된 메모리의 주소를 프리패치 메모리 주소라고 하겠다. 프리로더(215)는 프리패치 데이터를 프리로더 캐시에 저장할 수 있다. 프리로더 캐시는 L1 캐시보다 상위라는 의미에서 L0 캐시(L0 cache)라고도 할 수 있다. 다시 말해, L0 캐시는 프리패치 데이터의 저장에 사용될 수 있다. 프리로더(215)는 LDST 유닛(load/store unit)으로부터 요구 메모리 요청(demand memory request)를 수신하면, 요구 메모리 요청에 포함된 요구 메모리 주소와 프리로더 캐시에 포함된 프리패치 메모리 주소를 비교할 수 있다. 비교 결과에 따라서, 프리로더(215)는 프리패치 데이터를 LDST 유닛에 전달하거나 요구 메모리 요청을 하위 캐시로 전달할 수 있다.The preloader (215) can prefetch data from the lower cache, the L1 cache (216), the shared L2 cache (220), or the global memory (230). Hereinafter, data prefetched from the L1 cache (216), the shared L2 cache (220), or the global memory (230) will be referred to as prefetch data. In addition, the address of the memory where the prefetch data is stored will be referred to as a prefetch memory address. The preloader (215) can store the prefetch data in the preloader cache. The preloader cache can also be referred to as an L0 cache in the sense that it is higher than the L1 cache. In other words, the L0 cache can be used to store the prefetch data. When the preloader (215) receives a demand memory request from the LDST unit (load/store unit), it can compare the demand memory address included in the demand memory request with the prefetch memory address included in the preloader cache. Depending on the comparison result, the preloader (215) can pass the prefetch data to the LDST unit or pass the required memory request to the lower cache.
이하에서는, 프리로더(215) 및 프리패처가 프리패치 메모리 주소(prefetch memory address)를 예측하는 방법에 대해서 설명하도록 하겠다.Below, we will explain how the preloader (215) and the prefetcher predict the prefetch memory address.
도 3a 및 도3b는 보폭을 설명하기 위한 도면이다. 도 3a 및 도 3b에서 상술한 프리로더 캐시를 포함하는 프리로더가 아닌 프리로더 캐시를 포함하지 않는 프리패처를 기준으로 보폭을 결정하고 데이터를 L1 캐시로 프리패치하는 방법을 설명하겠다. Figures 3a and 3b are diagrams for explaining the stride. In Figures 3a and 3b, we will explain a method for determining the stride and prefetching data into the L1 cache based on a prefetcher that does not include a preloader cache, rather than a preloader that includes the preloader cache described above.
다만, 이하에서 설명하는 방법은 프리로더 캐시를 포함하는 프리로더에도 적용될 수 있음은 통상의 기술자에게 자명하다. 이때, 프리로더가 아래의 방법을 수행하는 경우, 도 6, 도 7a, 도 7b 및 도 7c에서 설명되듯이 프리패치 데이터는 L1 캐시가 아닌 프리로더 캐시에 저장될 수 있다.However, it is obvious to those skilled in the art that the method described below can also be applied to a preloader including a preloader cache. In this case, when the preloader performs the method below, the prefetch data can be stored in the preloader cache rather than the L1 cache, as described in FIG. 6, FIG. 7a, FIG. 7b, and FIG. 7c.
도 3a 및 도 3b를 참조하면, 프리패치 메모리 주소를 예측하기 위해 보폭(stride)을 결정하는 방법이 도시된다. 구체적으로, 도 3a는 인트라 워프 패턴 보폭(intra-warp pattern stride)을 결정하고 데이터를 프리패치하는 방법이 도시된다. 도 3b는 인터 워프 패턴 보폭(inter-warp pattern stride)을 결정하고 데이터를 프리패치하는 방법이 도시된다. Referring to FIGS. 3A and 3B, a method for determining a stride for predicting a prefetch memory address is illustrated. Specifically, FIG. 3A illustrates a method for determining an intra-warp pattern stride and prefetching data. FIG. 3B illustrates a method for determining an inter-warp pattern stride and prefetching data.
도 3a 및 도3 b에서, 블록(301)은 이전 요구 메모리 요청에 따른 이전 요구 메모리 주소를 나타낼 수 있다. 블록(303)은 프리패치 메모리 요청(prefetch memory request)에 포함된 프리패치 메모리 주소를 나타낼 수 있다. 블록(305)은, 다음 연산을 위한 요구 메모리 요청에 포함된 요구 메모리 주소를 나타낼 수 있다. In FIGS. 3A and 3B, block (301) may represent a previous request memory address according to a previous request memory request. Block (303) may represent a prefetch memory address included in a prefetch memory request. Block (305) may represent a request memory address included in a request memory request for a next operation.
이전 요구 메모리 요청에 따른 이전 요구 메모리 주소는 이전 연산에 이용된 데이터가 저장된 메모리 주소를 의미할 수 있다. 프리패치 메모리 요청에 포함된 프리패치 메모리 주소는 프리패처가 다음 연산에 이용될 것이라고 예측한 데이터가 저장된 메모리 주소를 의미할 수 있다. 다음 연산을 위한 요구 메모리 요청에 포함된 요구 메모리 주소는 LDST 유닛에 의해 요청된 다음 연산에 필요한 데이터가 저장된 메모리 주소를 의미할 수 있다.The previous requested memory address according to the previous requested memory request may mean a memory address where data used in the previous operation is stored. The prefetch memory address included in the prefetch memory request may mean a memory address where data predicted by the prefetcher to be used in the next operation is stored. The requested memory address included in the requested memory request for the next operation may mean a memory address where data required for the next operation requested by the LDST unit is stored.
인트라 워프 패턴 보폭은 동일한 워프로부터 생성된 요구 메모리 요청들 간의 보폭을 이용하여 프리패치 메모리 주소를 예측하는 알고리즘일 수 있다. 프리패처는 동일한 워프로부터 생성된 이전 요구 메모리 요청들에 포함된 이전 요구 메모리 주소들을 샘플링할 수 있다. 프리패처는 샘플링된 이전 요구 메모리 주소들 간의 보폭에 기반하여 프리패치 메모리 주소를 결정할 수 있다. 프리패처는 결정된 프리패치 메모리 주소에 저장된 데이터인 프리패치 데이터를 L1 캐시로 로딩하여 저장할 수 있다. 즉, 프리패처는 프리패치 데이터에 대해 프리패칭을 수행할 수 있다. 이후에, 다음 연산을 위한 요구 메모리 요청이 있는 경우, 프리패처는 요구 메모리 요청에 포함된 요구 메모리 주소와 L1 캐시에 저장된 프리패치 메모리 주소를 비교할 수 있다. 요구 메모리 주소와 프리패치 메모리 주소가 일치하는 경우, 프리패처는 L1 캐시에서 LDST 유닛으로 프리패치 데이터를 전달할 수 있다. Intra-warp pattern stride may be an algorithm that predicts a prefetch memory address by using the stride between request memory requests generated from the same warp. The prefetcher may sample previous request memory addresses included in previous request memory requests generated from the same warp. The prefetcher may determine a prefetch memory address based on the stride between the sampled previous request memory addresses. The prefetcher may load and store prefetch data, which is data stored in the determined prefetch memory address, into an L1 cache. That is, the prefetcher may perform prefetching on the prefetch data. Thereafter, when there is a request memory request for the next operation, the prefetcher may compare the request memory address included in the request memory request with the prefetch memory address stored in the L1 cache. If the request memory address and the prefetch memory address match, the prefetcher may transfer the prefetch data from the L1 cache to the LDST unit.
예를 들어, 도 3a를 참조하면, 프리패처는 동일한 워프 #00에서 생성된 이전 요구 메모리 요청에 포함된 이전 요구 메모리 주소들을 샘플링할 수 있다. 프리패처는 이전 요구 메모리 주소들 0x0100 및 0x0200 간의 보폭을 계산할 수 있다(도 3a에서 ①). 이때, 보폭은 0x0100 및 0x0200 간의 차이인 0x0100일 수 있다. 프리패처는 보폭을 이용하여 다음 연산에 필요한 프리패치 데이터가 저장된 프리패치 메모리 주소를 0x0300으로 예측할 수 있다(도 3a에서 ②). 프리패처는 0x0300에 위치한 프리패치 데이터를 L1 캐시에 로딩하여 저장할 수 있다. 다음 연산을 위해 워프 #00으로부터 요구 메모리 주소가 0x0300인 요구 메모리 요청이 생성되는 경우, LDST 유닛은 L1 캐시로 요구 메모리 요청을 전송할 수 있다. 이 때, L1 캐시에 저장되어 있고, 프리패치 메모리 주소 0x0300에 대응하는 프리패치 데이터는 LDST 유닛에 전송될 수 있다. 반면에, 요구 메모리 주소와 프리패치 메모리 주소가 상이한 경우, 요구 메모리 요청은 하위 캐시(예를 들어, L2 캐시)로 전달될 수 있다.For example, referring to FIG. 3a, the prefetcher can sample previous request memory addresses included in a previous request memory request generated from the
인터 워프 패턴 보폭은 상이한 워프로부터 생성된 요구 메모리 요청들 간의 보폭을 이용하여 프리패치 메모리 주소를 예측하는 알고리즘 일수 있다. 프리패처는 상이한 워프로부터 생성된 이전 요구 메모리 요청들에 포함된 이전 요구 메모리 주소들을 샘플링할 수 있다. 샘플링된 이전 요구 메모리 주소들을 이용하여 보폭을 결정하는 단계부터는 인트라 워프 패턴 보폭과 동일하므로 설명을 생략하도록 하겠다.Inter-warp pattern stride can be an algorithm that predicts prefetch memory addresses by using strides between request memory requests generated from different warps. The prefetcher can sample previous request memory addresses included in previous request memory requests generated from different warps. The step of determining the stride by using the sampled previous request memory addresses is the same as the intra-warp pattern stride, so the description will be omitted.
예를 들어, 도 3b를 참조하면, 프리패처는 상이한 워프 #00 및 워프 #01 각각으로부터 이전 요구 메모리 주소 0x0100 및 0x0200을 샘플링할 수 있다. 프리패처는 이전 요구 메모리 주소들 0x0100 및 0x0200을 이용하여 보폭을 0x0100으로 결정할 수 있다(도 3b에서 ①). 프리패처는 보폭을 이용하여 다음 연산을 위해 필요한 워프 #02가 필요로 하는 프리패치 데이터가 위치한 프리패치 메모리 주소를 0x0300으로 예측할 수 있다(도 3b에서 ②). 프리패처는 0x0300에 위치한 프리패치 데이터를 L1 캐시로 로딩하여 저장할 수 있다. 다음 연산을 위해 워프 #02으로부터 요구 메모리 주소가 0x0300인 요구 메모리 요청이 생성되는 경우, LDST 유닛은 L1 캐시로 요구 메모리 요청을 전송할 수 있다. 이때, L1 캐시에 저장되어 있고, 프리패치 메모리 주소 0x0300에 대응하는 프리패치 데이터는 LDST 유닛에 전송될 수 있다. 반면에, 요구 메모리 주소와 프리패치 메모리 주소가 상이한 경우, 요구 메모리 요청은 하위 캐시(예를 들어, L2 캐시)로 전달될 수 있다.For example, referring to FIG. 3b, the prefetcher can sample previous request memory addresses 0x0100 and 0x0200 from
이하에서는, L1 캐시에 데이터를 프리패치했을 때 발생할 수 있는 시나리오에 대해서 설명하도록 하겠다.Below, we will describe scenarios that can occur when prefetching data into the L1 cache.
도 4a 내지 도 4d는 복수의 프리패칭 시나리오를 설명하기 위한 도면이다.Figures 4a to 4d are diagrams for explaining multiple prefetching scenarios.
도 4a 내지 도 4d를 참조하면, GPU(400)는 스트리밍 멀티프로세서(410), 인터커넥션(420), L2 캐시(430) 및 글로벌 메모리(440)를 포함할 수 있다. 스트리밍 멀티프로세서(410)는 레지스터 파일(411), LDST 유닛(413), 프리패처(415) 및 L1 캐시(417)를 포함할 수 있다. Referring to FIGS. 4A to 4D, the GPU (400) may include a streaming multiprocessor (410), an interconnection (420), an L2 cache (430), and a global memory (440). The streaming multiprocessor (410) may include a register file (411), an LDST unit (413), a prefetcher (415), and an L1 cache (417).
도 4a를 참조하면, ①에서, 프리패처(415)는 다음 연산에 이용될 프리패치 데이터의 주소인 프리패치 메모리 주소를 예측할 수 있다. 프리패처(415)는 프리패치 메모리 주소를 포함하는 프리패치 메모리 요청을 생성하고, 프리패치 메모리 요청을 L1 캐시에 전달할 수 있다. 프리패치 메모리 요청은 L1 캐시에 프리패처 메모리 주소에 대응하는 프리패치 데이터가 로딩되어 있는지 여부를 확인할 수 있다. 프리패치 데이터가 로딩되어 있지 않은 경우 캐시 미스(cache miss)가 발생할 수 있다. 캐시 미스가 발생한 경우, 프리패치 메모리 요청은 인터커넥션(420)을 통해 하위 캐시인 L2 캐시(430) 및/또는 글로벌 메모리(440)로 전달될 수 있다. Referring to FIG. 4A, in ①, the prefetcher (415) can predict a prefetch memory address, which is an address of prefetch data to be used for the next operation. The prefetcher (415) can generate a prefetch memory request including the prefetch memory address, and transmit the prefetch memory request to the L1 cache. The prefetch memory request can check whether prefetch data corresponding to the prefetcher memory address is loaded in the L1 cache. If the prefetch data is not loaded, a cache miss may occur. If a cache miss occurs, the prefetch memory request may be transmitted to the L2 cache (430), which is a lower cache, and/or the global memory (440) through the interconnection (420).
② 에서, 프리패처 메모리 주소에 대응하는 프리패치 데이터가 L2 캐시(430) 및/또는 글로벌 메모리(440)에 존재하는 경우, 프리패치 메모리 요청에 따른 프리패치 메모리 응답(prefetch memory response)이 생성될 수 있다. 프리패치 메모리 응답은 인터커넥션(420)을 통해 L1 캐시(417)로 전달될 수 있다. 프리패치 메모리 응답은 프리패처 메모리 주소에 대응하는 프리패치 데이터를 포함할 수 있다. 프리패치 데이터 및 해당 프리패치 데이터에 대응하는 프리패치 메모리 주소는 L1 캐시(417)에 저장될 수 있다. ② In case that prefetch data corresponding to the prefetcher memory address exists in the L2 cache (430) and/or global memory (440), a prefetch memory response according to the prefetch memory request may be generated. The prefetch memory response may be transmitted to the L1 cache (417) via the interconnection (420). The prefetch memory response may include prefetch data corresponding to the prefetcher memory address. The prefetch data and the prefetch memory address corresponding to the prefetch data may be stored in the L1 cache (417).
③에서, LDST 유닛(413)은 L1 캐시(417)에 저장된 데이터를 레지스터 파일(411)로 로딩하기 위해 요구 메모리 요청을 생성할 수 있다. 요구 메모리 요청이 L1 캐시(417)에 전달되면, 요구 메모리 요청에 포함된 요구 메모리 주소는 L1 캐시(417)에 저장된 프리패치 메모리 주소와 비교될 수 있다. 요구 메모리 주소와 프리패치 메모리 주소가 일치하는 경우, 캐시 히트(cache hit)가 발생할 수 있다.③, the LDST unit (413) may generate a request memory request to load data stored in the L1 cache (417) into the register file (411). When the request memory request is transmitted to the L1 cache (417), the request memory address included in the request memory request may be compared with a prefetch memory address stored in the L1 cache (417). If the request memory address and the prefetch memory address match, a cache hit may occur.
④에서, 캐시 히트가 발생한 경우, 프리패치 데이터는 L1 캐시(417)로부터 LDST 유닛(413)을 통해 레지스터 파일(411)로 전송될 수 있다. 캐시 히트가 발생한 경우, 요구 메모리 요청은 L1 캐시(417)의 하위 캐시로 전달되지 않을 수 있다. 캐시 미스가 발생한 경우, 요구 메모리 요청은 L1 캐시(417)의 하위 캐시인 L2 캐시(430) 및/또는 글로벌 메모리(440)로 전달될 수 있다.④ In case of a cache hit, prefetch data may be transferred from the L1 cache (417) to the register file (411) through the LDST unit (413). If a cache hit occurs, the requested memory request may not be transferred to a lower cache of the L1 cache (417). If a cache miss occurs, the requested memory request may be transferred to the L2 cache (430), which is a lower cache of the L1 cache (417), and/or the global memory (440).
즉, 프리패치 메모리 요청이 발생한 후 요구 메모리 요청이 발생하여 프리패치 데이터가 미리 L1 캐시(417)로 로딩될 수 있다. 이때, 요구 메모리 요청이 L1 캐시(417)의 하위 캐시로 전달될 필요가 없어 메모리 지연이 감소하여 높은 성 향상을 획득할 수 있다.That is, after a prefetch memory request occurs, a demand memory request occurs so that prefetch data can be loaded into the L1 cache (417) in advance. At this time, the demand memory request does not need to be transferred to a lower cache of the L1 cache (417), so that memory delay is reduced and high performance improvement can be obtained.
도 4b를 참조하면, ①에서, 프리패처(415)는 다음 연산에 이용될 프리패치 데이터의 주소인 프리패치 메모리 주소를 예측할 수 있다. 프리패처(415)는 프리패치 메모리 주소를 포함하는 프리패치 메모리 요청을 생성하고, 프리패치 메모리 요청을 L1 캐시에 전달할 수 있다. 이때, 프리패치 데이터가 L1 캐시(417)에 이미 로딩되어 있어 캐시 히트가 발생할 수 있다. 프리패치 메모리 요청은 캐시 히트가 발생하여 삭제될 수 있다.Referring to FIG. 4b, in ①, the prefetcher (415) can predict a prefetch memory address, which is an address of prefetch data to be used for the next operation. The prefetcher (415) can generate a prefetch memory request including the prefetch memory address, and transmit the prefetch memory request to the L1 cache. At this time, a cache hit may occur because the prefetch data is already loaded into the L1 cache (417). The prefetch memory request may be deleted because a cache hit occurs.
②에서, LDST 유닛(413)은 L1 캐시에 저장된 데이터를 레지스터 파일(411)로 로딩하기 위해 요구 메모리 요청을 생성할 수 있다. 요구 메모리 요청이 L1 캐시(417)에 전달되면, 요구 메모리 요청에 포함된 요구 메모리 주소는 L1 캐시(417)에 저장된 프리패치 메모리 주소와 비교될 수 있다. 요구 메모리 주소와 프리패치 메모리 주소가 일치하는 경우, 캐시 히트(cache hit)가 발생할 수 있다.②, the LDST unit (413) can generate a request memory request to load data stored in the L1 cache into the register file (411). When the request memory request is transmitted to the L1 cache (417), the request memory address included in the request memory request can be compared with a prefetch memory address stored in the L1 cache (417). If the request memory address and the prefetch memory address match, a cache hit can occur.
③에서, 캐시 히트가 발생한 경우, 프리패치 데이터는 L1 캐시(417)로부터 LDST 유닛(413)을 통해 레지스터 파일(411)로 전송될 수 있다. ③ In case a cache hit occurs, prefetch data can be transferred from the L1 cache (417) to the register file (411) through the LDST unit (413).
다만, 도 4b는 이미 L1 캐시(417)에 데이터가 로딩되어 있으므로, 프리패칭에 의한 효과는 존재하지 않는다.However, since data has already been loaded into the L1 cache (417) in Fig. 4b, there is no effect due to prefetching.
도 4c를 참조하면, ① 및 ② 단계는 도 4a에서 설명한 바 설명을 생략하겠다.Referring to Fig. 4c, steps ① and ② will be omitted as described in Fig. 4a.
GPU은 수 천개의 쓰레드를 동시에 수행하여 L1 캐시(417)를 공유하는 구조일 수 있다. 따라서, L1 캐시(417)의 크기는 제한적일 수 있다.A GPU may be structured to execute thousands of threads simultaneously and share an L1 cache (417). Therefore, the size of the L1 cache (417) may be limited.
따라서, ③에서, ① 및 ② 단계를 통해 L1 캐시(417)에 저장된 프리패치 데이터가 적출(eviction)될 수 있다. 예를 들어, L1 캐시(417)에 요구 메모리 요청이 도달하기 전에 다른 워프(또는, 쓰레드)의 요구 메모리 요청에 의해 프리패치 데이터가 적출되고, 다른 워프(또는, 쓰레드)가 필요로 하는 데이터가 쓰여 질 수 있다. Therefore, in ③, the prefetch data stored in the L1 cache (417) can be eviction through
④에서, 요구 메모리 요청이 생성되었지만, 이미 프리패치 데이터가 적출된 이후일 수 있다. 따라서, 요구 메모리 요청이 L1 캐시(417)에 전달되어도 프리 패치 데이터는 이미 적출되었으므로 캐시 미스가 발생할 수 있다. 따라서, 요구 메모리 요청은 인터커넥션(420)을 통해 L2 캐시(430) 또는 글로벌 메모리(440)로 전달될 수 있다.④ In the request memory request, the request memory request is generated, but it may be after the prefetch data has already been extracted. Therefore, even if the request memory request is delivered to the L1 cache (417), a cache miss may occur because the prefetch data has already been extracted. Therefore, the request memory request may be delivered to the L2 cache (430) or the global memory (440) through the interconnection (420).
⑤에서, 요구 메모리 요청에 따른 요구 메모리 응답으로 데이터가 L2 캐시(430) 또는 글로벌 메모리(440)로부터 LDST 유닛(413)을 통해 레지스터 파일(411)로 전송될 수 있다.⑤ In response to a demand memory request, data can be transferred from the L2 cache (430) or global memory (440) to the register file (411) through the LDST unit (413).
다시 말해, 프리패치 데이터가 정상적으로 L1 캐시(417)에 로딩되었음에도 적출됨으로써 다시 L2 캐시(430) 또는 글로벌 메모리(440)로부터 데이터를 로딩하기 위해 수백 사이클이 소요되는 문제가 있을 수 있다. 따라서, L1 캐시(417), 인터커넥션(420), L2 캐시(430) 및 글로벌 메모리(440)의 부하가 증가할 수 있다. 결국, 메모리 지연이 급격히 증가하여 GPU의 성능이 감소할 수 있다.In other words, there may be a problem that hundreds of cycles are required to load the data again from the L2 cache (430) or global memory (440) because the prefetch data is extracted even though it has been normally loaded into the L1 cache (417). Accordingly, the load on the L1 cache (417), interconnection (420), L2 cache (430), and global memory (440) may increase. Ultimately, the memory delay may increase rapidly, which may reduce the performance of the GPU.
도 4d를 참조하면, ①에서, 프리패처(415)가 다음 연산에 필요한 프리패치 데이터가 위치한 프리패치 메모리 주소를 예측하였으나, 예측이 잘못될 수 있다. 즉, 도 4a에서 설명한 ① 및 ② 단계를 통해 프리패치 데이터를 L1 캐시(417)에 로딩할 수 있지만, 예측이 틀려 프리패치 데이터가 불필요하게 L1 캐시(417)의 공간만을 점유할 수 있다. Referring to FIG. 4d, in ①, the prefetcher (415) predicts the prefetch memory address where the prefetch data required for the next operation is located, but the prediction may be incorrect. That is, the prefetch data may be loaded into the L1 cache (417) through
③에서, LDST 유닛(413)이 L1 캐시(417)에 저장된 데이터를 레지스터 파일(411)로 로딩하기 위해 요구 메모리 요청을 생성했으나, 프리패치 메모리 주소의 예측이 틀려 캐시 미스가 발생할 수 있다. 캐시 미스가 발생한 이후의 단계는 도 4c에서 상술한바 설명을 생략하도록 하겠다. ③ In
결과적으로, 예측이 틀린 경우에도 프리패치 데이터가 적출된 경우와 마찬가지로 메모리 지연이 급격히 증가하여 GPU의 성능이 감소하는 문제가 있을 수 있다. 다만, GPU에서 실행되는 애플리케이션은 대체로 일정한 보폭을 갖기 때문에 예측이 잘못되는 경우는 제한적으로 발생할 수 있다.As a result, even if the prediction is wrong, there may be a problem where the memory latency increases sharply and the GPU performance decreases just like when the prefetch data is extracted. However, since the application running on the GPU generally has a constant stride, the cases where the prediction is wrong can be limited.
이하에서는, 별도의 프리로더 캐시를 포함하는 프리로더를 이용하여 상술한 문제를 해결하는 방법에 대해서 설명하겠다.Below, we will describe a method to solve the above-described problem by using a preloader that includes a separate preloader cache.
도 5는 본 개시의 일 실시예에 따른 프리로더를 포함하는 전자 장치의 동작을 설명하기 위한 플로우 차트이다.FIG. 5 is a flow chart illustrating the operation of an electronic device including a preloader according to one embodiment of the present disclosure.
이하 실시예에서 각 동작들은 순차적으로 수행될 수도 있으나, 반드시 순차적으로 수행되는 것은 아니다. 예를 들어, 각 동작들의 순서가 변경될 수도 있으며, 적어도 두 동작들이 병렬적으로 수행될 수도 있다. 단계(501) 내지 단계(509)는 프로세서에 의해 수행될 수 있으나 실시예가 이에 한정되지 않으며 프리로더에 의해 수행될 수도 있다.In the following embodiments, the operations may be performed sequentially, but are not necessarily performed sequentially. For example, the order of the operations may be changed, and at least two operations may be performed in parallel. Steps (501) to (509) may be performed by the processor, but the embodiment is not limited thereto, and may be performed by the preloader.
단계(501)에서, 프로세서는 이전 요구 메모리 요청에 포함된 이전 요구 메모리 주소들을 샘플링할 수 있다. At step (501), the processor may sample previous requested memory addresses included in the previous requested memory request.
프로세서는 동일한 워프의 이전 요구 메모리 요청에 포함된 이전 요구 메모리 주소들을 샘플링할 수 있다. 또는, 프로세서는 상이한 워프의 이전 요구 메모리 요청에 포함된 이전 요구 메모리 주소들을 샘플링할 수 있다.The processor may sample previous request memory addresses included in previous request memory requests of the same warp. Alternatively, the processor may sample previous request memory addresses included in previous request memory requests of a different warp.
단계(502)에서, 프로세서는 샘플링된 이전 요구 메모리 주소들 간의 보폭에 기반하여 프리패치 메모리 요청을 생성할 수 있다.At step (502), the processor may generate a prefetch memory request based on the stride between sampled previous requested memory addresses.
프로세서는 동일한 워프의 이전 요구 메모리 주소들 간의 보폭에 기반하여 인트라 워프 패턴 보폭을 결정할 수 있다. 프로세서는 상이한 워프의 이전 요구 메모리 주소들 간의 보폭에 기반하여 인터 워프 패턴 보폭을 결정할 수 있다. 프로세서는 인트라 워프 패턴 보폭 및/또는 인터 워프 패턴 보폭에 기반하여 다음 연산에 필요한 데이터가 저장된 프리패치 메모리 주소를 예측할 수 있다. 프리 패치 메모리 요청은 예측된 프리패치 메모리 주소를 포함할 수 있다.The processor can determine an intra-warp pattern stride based on a stride between previous requested memory addresses of the same warp. The processor can determine an inter-warp pattern stride based on a stride between previous requested memory addresses of different warps. The processor can predict a prefetch memory address where data required for a next operation is stored based on the intra-warp pattern stride and/or the inter-warp pattern stride. The prefetch memory request can include the predicted prefetch memory address.
프로세서가 보폭을 결정한 결과, 보폭이 인트라 워프 패턴 보폭 및 인터 워프 패턴 보폭을 모두 포함할 수 있다. 이때, 인트라 워프 패턴 보폭의 우선순위가 인터 워프 패턴 보폭보다 높을 수 있다. 따라서, 보폭을 결정한 결과, 보폭이 인트라 워프 패턴 보폭 및 인터 워프 패턴 보폭을 모두 포함하고, 인트라 워프 패턴 보폭 및 인터 워프 패턴 보폭이 상이한 경우, 프로세서는 인트라 워프 패턴 보폭에 기반하여 프리패치 메모리 요청을 생성할 수 있다.As a result of the processor determining the stride, the stride may include both the intra-warp pattern stride and the inter-warp pattern stride. At this time, the priority of the intra-warp pattern stride may be higher than that of the inter-warp pattern stride. Therefore, if as a result of the processor determining the stride, the stride includes both the intra-warp pattern stride and the inter-warp pattern stride, and the intra-warp pattern stride and the inter-warp pattern stride are different, the processor may generate a prefetch memory request based on the intra-warp pattern stride.
단계(503)에서, 프리패치 메모리 요청에 따른 프리패치 메모리 응답을 프리로더에 전달할 수 있다.In step (503), a prefetch memory response according to a prefetch memory request can be transmitted to the preloader.
프로세서는 프리패치 메모리 요청을 프리로더에 포함되는 프리로더 캐시의 하위 캐시로 전달할 수 있다. 프리로더 캐시의 하위 캐시는 L1 캐시, L2 캐시 및 글로벌 메모리일 수 있다. 프리패치 메모리 요청을 수신한 하위 캐시에 프리패치 데이터가 저장되어 있는 경우, 프리패치 메모리 응답이 생성될 수 있다. 프로세서는 생성된 프리패치 메모리 응답을 프리로더에 전송할 수 있다. 프리패치 메모리 응답은 프리패치 데이터를 포함할 수 있다. 예를 들어, 프리패치 데이터가 L2 캐시에 존재하는 경우, L2 캐시에서 프리패치 메모리 응답이 생성될 수 있다. 프리패치 메모리 응답은 L2 캐시로부터 프리로더로 전송될 수 있고, 프리패치 메모리 응답은 프리패치 데이터를 포함할 수 있다.The processor can forward the prefetch memory request to a sub-cache of the preloader cache included in the preloader. The sub-cache of the preloader cache can be an L1 cache, an L2 cache, and a global memory. If prefetch data is stored in the sub-cache that received the prefetch memory request, a prefetch memory response can be generated. The processor can transmit the generated prefetch memory response to the preloader. The prefetch memory response can include the prefetch data. For example, if the prefetch data exists in the L2 cache, the prefetch memory response can be generated in the L2 cache. The prefetch memory response can be transmitted from the L2 cache to the preloader, and the prefetch memory response can include the prefetch data.
단계(504)에서, 프로세서는 프리패치 메모리 요청에 포함되는 프리패치 데이터 및 프리패치 데이터에 대응하는 프리패치 메모리 주소를 프리로더 캐시에 저장할 수 있다. In step (504), the processor can store prefetch data included in the prefetch memory request and a prefetch memory address corresponding to the prefetch data in a preloader cache.
프로세서는 요구 메모리 요청이 프리로더에 수신되었을 때 프리패치 메모리 주소가 제대로 예측되었는지 여부를 확인하기 위해 프리패치 메모리 주소를 저장할 수 있다. 요구 메모리 요청은 요구 메모리 주소를 포함할 수 있다. 요구 메모리 주소는 다음 연산을 위해 명령어가 필요한 데이터가 저장된 주소를 의미할 수 있다. 따라서, 프리패치 데이터가 정확히 프리로더 캐시에 로딩된 경우, 프리패치 메모리 주소와 요구 메모리 주소는 일치할 수 있다.The processor may store the prefetch memory address to check whether the prefetch memory address is correctly predicted when a demand memory request is received by the preloader. The demand memory request may include the demand memory address. The demand memory address may mean an address where data required by an instruction for the next operation is stored. Therefore, if the prefetch data is correctly loaded into the preloader cache, the prefetch memory address and the demand memory address may match.
단계(505)에서, 프로세서는 LDST 유닛에서 생성된 다음 연산을 위한 요구 메모리 요청을 프리로더로 전달할 수 있다.At step (505), the processor may forward a request for memory for the next operation generated in the LDST unit to the preloader.
단계(506)에서, 프로세서는 요구 메모리 주소와 프리로더 캐시에 저장된 프리패치 메모리 주소가 일치하는 지 여부를 확인할 수 있다. At step (506), the processor can check whether the requested memory address matches the prefetch memory address stored in the preloader cache.
단계(507)에서, 요구 메모리 주소와 프리로더 캐시에 저장된 프리패치 메모리 주소가 일치하지 않는 경우, 프로세서는 요구 메모리 요청을 하위 캐시로 전달할 수 있다.In step (507), if the requested memory address does not match the prefetch memory address stored in the preloader cache, the processor may forward the requested memory request to a lower cache.
다시 말해, 프로세서는 요구 메모리 요청을 프리로더에 포함된 캐시의 하위 캐시로 요구 메모리 요청을 전달할 수 있다. 여기서, 하위 캐시는 L1 캐시, L2 캐시 및 글로벌 메모리를 포함할 수 있다. In other words, the processor can forward the requested memory request to a sub-cache of the cache included in the preloader, where the sub-cache can include the L1 cache, the L2 cache, and the global memory.
단계(508)에서, 프로세서는 하위 캐시에 저장된 데이터를 LDST 유닛에 전송할 수 있다.At step (508), the processor can transfer data stored in the lower cache to the LDST unit.
요구 메모리 요청을 수신한 하위 캐시가 요구 메모리 주소에 대응하는 데이터를 포함하고 있는 경우, 프로세서는 요구 메모리 응답을 LDST 유닛에 전송할 수 있다. 요구 메모리 응답은 요구 메모리 주소에 대응하는 데이터를 포함할 수 있다. If the lower cache that received the requested memory request contains data corresponding to the requested memory address, the processor may transmit a requested memory response to the LDST unit. The requested memory response may contain data corresponding to the requested memory address.
단계(509)에서, 요구 메모리 주소와 프리로더 캐시에 저장된 프리패치 메모리 주소가 일치하는 경우, 프로세서는 프리로더 캐시에 저장된 프리패치 데이터를 LDST 유닛으로 전송할 수 있다.In step (509), if the requested memory address matches the prefetch memory address stored in the preloader cache, the processor can transfer the prefetch data stored in the preloader cache to the LDST unit.
다시 말해, 프로세서는 요구 메모리 요청에 대한 응답으로 프리로더 캐시에 저장된 프리패치 데이터를 LDST 유닛으로 전송할 수 있다.In other words, the processor can transfer prefetch data stored in the preloader cache to the LDST unit in response to a demand memory request.
결국, 다음 연산에 필요하다고 예측된 데이터가 L1 캐시가 아닌 프리로더 캐시에 저장됨으로써 도 4c와 같은 데이터의 적출을 방지할 수 있다. Ultimately, data predicted to be needed for the next operation can be stored in the preloader cache rather than the L1 cache, thereby preventing data extraction as in Fig. 4c.
이하에서는 상술한 프리로더를 포함하는 프로세서의 동작을 도면을 이용하여 설명하도록 하겠다.Below, the operation of a processor including the above-described preloader will be explained using drawings.
도 6은 본 개시의 일 실시예에 따른 GPU의 동작을 설명하기 위한 플로우 차트이다.FIG. 6 is a flow chart for explaining the operation of a GPU according to one embodiment of the present disclosure.
도 6을 참조하면, GPU(600)는 스트리밍 멀티프로세서(610), 인터커넥션(620), L2 캐시(630) 및 글로벌 메모리(640)를 포함할 수 있다. 스트리밍 멀티프로세서(610)는 레지스터 파일(611), LDST 유닛(613), 프리로더(615) 및 L1 캐시(617)를 포함할 수 있다. 프리로더(615)는 내부 저장 장치인 캐시(미도시)를 포함할 수 있다. 이하에서는 프리로더(615)에 포함된 캐시(미도시)를 프리로더 캐시(preloader cache)라고 하겠다.Referring to FIG. 6, the GPU (600) may include a streaming multiprocessor (610), an interconnection (620), an L2 cache (630), and a global memory (640). The streaming multiprocessor (610) may include a register file (611), an LDST unit (613), a preloader (615), and an L1 cache (617). The preloader (615) may include a cache (not shown), which is an internal storage device. Hereinafter, the cache (not shown) included in the preloader (615) will be referred to as a preloader cache.
프리로더(615)는 이전 요구 메모리 요청에 포함된 이전 요구 메모리 주소들을 샘플링할 수 있다. 프리로더(615)는 샘플링된 이전 요구 메모리 주소들을 이용하여 보폭을 결정할 수 있다. 프리로더(615)는 샘플링된 이전 요구 메모리 주소들을 보폭이 이용하여 인터 워프 패턴 보폭 및/또는 인트라 워프 패턴 보폭인지 여부를 결정할 수 있다. 프리로더(615)는 결정한 보폭에 기반하여 다음 연산에 이용될 데이터가 저장된 주소인 프리패치 메모리 주소를 예측할 수 있다. 다시 말해, 프리로더(615)는 LDST 유닛에 의해 생성될 요구 메모리 요청에 포함될 요구 메모리 주소를 예측할 수 있다.The preloader (615) can sample previous request memory addresses included in a previous request memory request. The preloader (615) can determine a stride using the sampled previous request memory addresses. The preloader (615) can determine whether the stride is an inter-warp pattern stride and/or an intra-warp pattern stride using the sampled previous request memory addresses. The preloader (615) can predict a prefetch memory address, which is an address where data to be used for a next operation is stored, based on the determined stride. In other words, the preloader (615) can predict a request memory address to be included in a request memory request to be generated by the LDST unit.
이후, 프리로더(615)는 프리패치 메모리 주소를 포함하는 프리패치 메모리 요청을 생성할 수 있다. 프리패치 메모리 요청은 L1 캐시(617)로 전달될 수 있다. L1 캐시에 프리패치 메모리 주소에 대응하는 프리패치 데이터가 존재하는 경우 캐시 히트가 발생할 수 있다. 캐시 히트가 발생한 경우, 프리패치 메모리 요청에 따른 프리패치 메모리 응답이 L1 캐시(617)로부터 프리로더(615)에 전송될 수 있다. 이때, 프리패치 메모리 응답은 프리패치 데이터를 포함할 수 있다. 프리로더(615)는 프리패치 메모리 응답을 수신하여 프리패치 데이터를 프리로더 캐시에 저장할 수 있다. Thereafter, the preloader (615) may generate a prefetch memory request including a prefetch memory address. The prefetch memory request may be forwarded to the L1 cache (617). If prefetch data corresponding to the prefetch memory address exists in the L1 cache, a cache hit may occur. If a cache hit occurs, a prefetch memory response according to the prefetch memory request may be transmitted from the L1 cache (617) to the preloader (615). At this time, the prefetch memory response may include prefetch data. The preloader (615) may receive the prefetch memory response and store the prefetch data in the preloader cache.
반면에, L1 캐시(617)에 프리패치 메모리 주소에 대응하는 프리패치 데이터가 존재하지 않는 경우, 캐시 미스가 발생할 수 있다. 이때, 프리패치 메모리 요청은 인터커넥션(620)을 통해 하위 캐시로 전달될 수 있다. 프리패치 메모리 요청을 수신한 하위 캐시에 프리패치 메모리 주소에 대응하는 프리패치 데이터가 존재하는 경우, 캐시 히트가 발생하고 해당 하위 캐시에서 프리 패치 메모리 응답이 생성될 수 있다. 이때, 프리패치 메모리 응답은 프리로더(615)까지 전송될 수 있다. 프리로더(615)는 프리패치 메모리 응답에 포함된 프리패치 데이터를 프리로더 캐시에 저장할 수 있다. On the other hand, if there is no prefetch data corresponding to the prefetch memory address in the L1 cache (617), a cache miss may occur. At this time, the prefetch memory request may be transmitted to a lower cache through the interconnection (620). If there is prefetch data corresponding to the prefetch memory address in the lower cache that received the prefetch memory request, a cache hit may occur and a prefetch memory response may be generated in the lower cache. At this time, the prefetch memory response may be transmitted to the preloader (615). The preloader (615) may store the prefetch data included in the prefetch memory response in the preloader cache.
예를 들어, L2 캐시에도 프리패치 데이터가 존재하지 않는 경우, 캐시 미스가 발생하고 프리패치 메모리 요청은 글로벌 메모리(640)까지 전달될 수 있다. 글로벌 메모리(640)에 프리패치 데이터가 존재하는 경우, 프리패치 메모리 응답이 생성될 수 있다. 생성된 프리패치 메모리 응답은 프리로더(615)까지 전송될 수 있다. For example, if prefetch data does not exist in the L2 cache, a cache miss occurs and a prefetch memory request may be forwarded to the global memory (640). If prefetch data exists in the global memory (640), a prefetch memory response may be generated. The generated prefetch memory response may be transmitted to the preloader (615).
그 다음, LDST 유닛(613)에서 다음 연산을 위해 필요한 데이터를 레지스터 파일(611)에 로딩하기 위해 요구 메모리 요청을 생성할 수 있다. 요구 메모리 요청은 다음 연산을 위해 필요한 데이터가 저장된 요구 메모리 주소를 포함할 수 있다. Next, the LDST unit (613) may generate a demand memory request to load data required for the next operation into the register file (611). The demand memory request may include a demand memory address where the data required for the next operation is stored.
요구 메모리 요청은 프리로더(615)로 전달될 수 있다. 프리로더 캐시에 저장된 프리패치 데이터의 프리패치 데이터 주소와 요구 메모리 요청의 요구 메모리 주소를 비교하여 동일한 경우, 프리패치 데이터는 LDST 유닛(613)을 통해 레지스터 파일(611)에 로딩될 수 있다. The demand memory request can be forwarded to the preloader (615). If the prefetch data address of the prefetch data stored in the preloader cache is compared with the demand memory address of the demand memory request and they are the same, the prefetch data can be loaded into the register file (611) through the LDST unit (613).
결국, 요구 메모리 요청이 L1 캐시(617) 또는 그 이하의 캐시까지 접근하지 않더라도 프리패치 데이터가 레지스터 파일(611)로 로딩될 수 있다. 다시 말해, 최소의 메모리 지연만으로 필요한 데이터를 레지스터 파일(611)에 로딩할 수 있다.Ultimately, prefetch data can be loaded into the register file (611) even if the required memory request does not access the L1 cache (617) or lower caches. In other words, required data can be loaded into the register file (611) with minimal memory delay.
이하에서는, 프리로더(615)의 내부 동작을 설명하도록 하겠다. Below, the internal operation of the preloader (615) will be explained.
도 7a 내지 도 7c는 본 개시의 일 실시예에 따른 프리로더의 동작을 설명하기 위한 도면이다.FIGS. 7A to 7C are drawings for explaining the operation of a preloader according to one embodiment of the present disclosure.
도 7a 내지 도 7c를 참조하면, LDST 유닛(710), 프리로더(720) 및 L1 캐시(730)가 도시된다. 프리로더(720)는 프리패치 주소 생성기(721) 및 프리로더 캐시(723)를 포함할 수 있다. 프리로더 캐시(723)는 프리로더(720)의 내부 저장 장치일 수 있다. 프리로더(720)는 LDST 유닛(710)과 연결될 수 있다. 따라서, LDST 유닛(710)에서 생성되는 모든 요구 메모리 요청은 프리로더(720)를 통과할 수 있다. 최근 GPU는 128 바이트 크기의 캐시 라인을 4개의 32 바이트 크기의 섹터(sector)로 분할하는 섹터 L1 캐시를 이용할 수 있다. 섹터 L1 캐시는 128 바이트 크기의 캐시 라인을 모두 로딩하는 대신 섹터 측면에서 데이터를 로딩할 수 있다. L1 캐시(730)는 섹터 L1 캐시일 수 있다.Referring to FIGS. 7A to 7C, an LDST unit (710), a preloader (720), and an L1 cache (730) are illustrated. The preloader (720) may include a prefetch address generator (721) and a preloader cache (723). The preloader cache (723) may be an internal storage device of the preloader (720). The preloader (720) may be connected to the LDST unit (710). Accordingly, all required memory requests generated from the LDST unit (710) may pass through the preloader (720). Recent GPUs may utilize a sector L1 cache that divides a 128-byte sized cache line into four 32-byte sized sectors. The sector L1 cache may load data at the sector level instead of loading the entire 128-byte sized cache line. The L1 cache (730) may be a sector L1 cache.
프리로더 캐시(723)는 엔트리의 상태, 프리패치 메모리 주소 및 프리패치 데이터를 저장하기 위해 각 워프 마다 하나의 엔트리를 포함할 수 있다. 따라서, 프리로더 캐시(723)는 총 64개의 엔트리를 포함할 수 있다. 다시 말해, 프리로더 캐시(723)는 총 64개의 행을 가질 수 있다. 엔트리들 각각은 워프 ID로 인덱싱될 수 있다. 예를 들어, 첫번째 엔트리는 워프 #00로 인덱싱 될 수 있고, 두번째 엔트리는 워프 #01로 인덱싱 될 수 있다. 엔트리들 각각은 엔트리의 상태를 나타내는 상태 비트 4 비트, 프리패치 메모리 주소를 나타내는 106 비트 및 프리패치 데이터를 나타내는 1024 비트를 포함할 수 있다. The preloader cache (723) may include one entry per warp to store the status of the entry, the prefetch memory address, and the prefetch data. Therefore, the preloader cache (723) may include a total of 64 entries. In other words, the preloader cache (723) may have a total of 64 rows. Each of the entries may be indexed by a warp ID. For example, the first entry may be indexed by
프리로더(720)는 섹터 크기의 데이터를 프리패칭하기 위해 복수의 서브 프리패치 메모리 요청(sub-prefetch memory request)들을 생성할 수 있다. 이하에서는 설명의 편의를 위해 프리패치 메모리 요청이 4개의 서브 프리패치 메모리 요청들로 구성된다고 가정하겠다. 따라서, 본 개시는 프리패치 메모리 요청이 4개인 경우에 한정되지 않음은 통상의 기술자에게 자명하다. 이때, 4개의 서브 프리패치 메모리 요청들 각각은 4개의 상이한 캐시 라인에 위치한 섹터의 데이터에 접근할 수 있다. The preloader (720) can generate multiple sub-prefetch memory requests to prefetch sector-sized data. For convenience of explanation, it will be assumed below that a prefetch memory request consists of four sub-prefetch memory requests. Therefore, it will be apparent to those skilled in the art that the present disclosure is not limited to the case where there are four prefetch memory requests. In this case, each of the four sub-prefetch memory requests can access data of sectors located in four different cache lines.
도 7a는 프리패치 메모리 요청을 생성하는 방법을 설명하기 위한 도면이다. 이하에서, ① 내지 ⑦은 설명의 편의를 위한 숫자일 뿐, 동작이 순차적으로 수행됨을 의미하는 것은 아니다. Figure 7a is a diagram for explaining a method of generating a prefetch memory request. In the following, ① to ⑦ are numbers only for convenience of explanation and do not mean that the operations are performed sequentially.
①에서, 프리패치 주소 생성기(721)는 프리패치 메모리 요청을 생성할 수 있다. 프리패치 메모리 요청은 프리패치 메모리 주소를 포함하고 L1 캐시(730)으로 전달될 수 있다. 프리패치 주소 생성기(721)는 각 워프에 대해 서브 프리패치 메모리 요청을 4개까지 생성할 수 있다. 각 서브 프리패치 메모리 요청은 L1 캐시로 전달되는 하나의 섹터에 대한 요청일 수 있다. 다시 말해, 프리패치 메모리 요청은 4개의 서브 프리패치 메모리 요청으로 구성될 수 있다. 서브 프리패치 메모리 요청들 각각은 주소를 포함할 수 있다. 프리패치 메모리 주소는 4개의 서브 프리패치 메모리 요청들에 포함되는 주소로 구성될 수 있다.① In the prefetch address generator (721), a prefetch memory request can be generated. The prefetch memory request includes a prefetch memory address and can be delivered to the L1 cache (730). The prefetch address generator (721) can generate up to four sub-prefetch memory requests for each warp. Each sub-prefetch memory request can be a request for one sector delivered to the L1 cache. In other words, the prefetch memory request can be composed of four sub-prefetch memory requests. Each of the sub-prefetch memory requests can include an address. The prefetch memory address can be composed of addresses included in the four sub-prefetch memory requests.
②에서, 요구 메모리 요청에 포함된 요구 메모리 주소와 프리패치 메모리 요청에 포함된 프리패치 메모리 주소가 일치하는지 여부를 확인하기 위해 프리로더(720)는 프리패치 메모리 주소를 프리로더 캐시(723)에 저장할 수 있다. 이때, 프리패치 메모리 주소 전부를 저장하기보다 프리패치 메모리 주소를 구성하는 4개의 서브 프리패치 메모리 요청의 주소 일부만을 저장할 수 있다.② In order to check whether the requested memory address included in the requested memory request matches the prefetch memory address included in the prefetch memory request, the preloader (720) may store the prefetch memory address in the preloader cache (723). At this time, rather than storing the entire prefetch memory address, only a part of the addresses of the four sub-prefetch memory requests constituting the prefetch memory address may be stored.
즉, ③에서, 4개의 서브 프리패치 메모리 요청의 주소를 모두 저장하기 보다 제1 서브 프리패치 메모리 요청에 포함되는 주소 및 다른 서브 프리패치 메모리 요청에 포함되는 주소의 오프셋이 저장할 수 있다. 오프셋은 20 비트로 제한되지만, LSB(least significant bit) 6 비트는 섹터 오프셋으로 이를 제외한 14비트만이 저장될 수 있다. That is, in ③, rather than storing all addresses of the four sub-prefetch memory requests, the offsets of the addresses included in the first sub-prefetch memory request and the addresses included in the other sub-prefetch memory requests can be stored. The offset is limited to 20 bits, but only 14 bits, excluding the least significant bit (LSB) 6 bits, can be stored as a sector offset.
따라서, ⑥에서, 제1 서브 프리패치 메모리 요청에 포함되는 주소 64 비트 및 다른 서브 프리패치 메모리 요청들 각각의 오프셋 14비트가 결합될 수 있다. Therefore, in ⑥, the 64-bit address included in the first sub-prefetch memory request and the 14-bit offset of each of the other sub-prefetch memory requests can be combined.
결국, ⑦에서, 프리패치 메모리 주소는 106 비트로 변환되어 프리로더 캐시(723)에 저장될 수 있다. Finally, in ⑦, the prefetch memory address can be converted to 106 bits and stored in the preloader cache (723).
④에서, 프리로더 캐시(723)에 상술한 106비트로 변환된 주소를 저장하기 위해 프리로더(720)는 워프 ID를 인덱스로 이용할 수 있다. 프리로더(720)는 하나의 워프에 대해 하나의 프리패치 메모리 요청을 생성할 수 있으므로, 프리로더 캐시(723)는 엔트리의 상태, 변환된 주소 및 프리패치 데이터를 저장하기 위해 64개의 엔트리를 가질 수 있다. 엔트리들 각각은 워프 ID로 인덱싱되므로, 프리로더(720)는 변환된 주소를 저장하기 위해 워프 ID를 인덱스로 이용할 수 있다.④ In order to store the 106-bit converted address described above in the preloader cache (723), the preloader (720) can use the warp ID as an index. Since the preloader (720) can generate one prefetch memory request for one warp, the preloader cache (723) can have 64 entries to store the state of the entry, the converted address, and the prefetch data. Since each of the entries is indexed by the warp ID, the preloader (720) can use the warp ID as an index to store the converted address.
⑤에서, 프리패치 메모리 요청이 L1 캐시(730)으로 전달된 경우, 엔트리의 상태를 나타내는 상태 비트가 업데이트 될 수 있다. 상태 비트는 프리패치 메모리 요청이 생성되었음을 나타내도록 업데이트 될 수 있다. 엔트리의 상태가 업데이트되는 방법은 도 8에서 더 설명하도록 하겠다.⑤ In case a prefetch memory request is forwarded to the L1 cache (730), a status bit indicating the status of the entry may be updated. The status bit may be updated to indicate that a prefetch memory request has been generated. The method by which the status of the entry is updated will be further described in FIG. 8.
도 7b는 LDST 유닛(710)으로부터 프리로더(720)로 요구 메모리 요청이 전달되었을 때를 설명하기 위한 도면이다. ① 내지 ⑥은 설명의 편의를 위한 숫자일 뿐, 동작이 순차적으로 수행됨을 의미하는 것은 아니다. Figure 7b is a diagram for explaining when a request for memory is transmitted from the LDST unit (710) to the preloader (720). ① to ⑥ are numbers only for convenience of explanation and do not mean that the operations are performed sequentially.
요구 메모리 요청은 4개의 요구 서브 메모리 요청들(demand sub-memory requests)으로 구성될 수 있다. 이하에서는 설명의 편의를 위해 요구 메모리 요청은 4개의 요구 서브 메모리 요청들로 구성된다고 가정하겠다. 다만, 본 개시는 요구 서브 메모리 요청들이 4개인 경우에 한정되지 않음은 통상의 기술자에게 자명하다. 요구 서브 메모리 요청들 각각은 요구 주소(demand address)를 포함할 수 있다. 요구 메모리 요청은 요구 메모리 주소를 포함할 수 있다. 요구 메모리 주소는 요구 서브 메모리 요청들의 요구 주소로 구성될 수 있다.A demand memory request can be composed of four demand sub-memory requests. For convenience of explanation, it will be assumed below that a demand memory request is composed of four demand sub-memory requests. However, it will be apparent to those skilled in the art that the present disclosure is not limited to the case where there are four demand sub-memory requests. Each of the demand sub-memory requests can include a demand address. A demand memory request can include a demand memory address. The demand memory address can be composed of demand addresses of the demand sub-memory requests.
①에서, 요구 메모리 요청이 프리로더(720)에 도착하면, 프리로더(720)는 워프 ID를 이용하여 프리로더 캐시(723)에서 엔트리를 선택할 수 있다. 요구 메모리 요청은 특정 워프의 다음 연산에 대한 것일 수 있다. 따라서, 프리로더(720)는 이 특정 워프의 워프 ID를 이용하여 프리로더 캐시(723)에서 엔트리를 선택할 수 있다.① In case a demand memory request arrives at the preloader (720), the preloader (720) can select an entry from the preloader cache (723) using the warp ID. The demand memory request may be for the next operation of a specific warp. Therefore, the preloader (720) can select an entry from the preloader cache (723) using the warp ID of this specific warp.
②에서, 요구 서브 메모리 요청들의 오프셋은 도 7a에서 프리패치 서브 메모리 주소와 동일한 방식으로 계산될 수 있다. 즉, 제1 요구 서브 메모리 요청을 제외한 다른 요구 서브 메모리 요청들의 요구 주소에서 오프셋은 20 비트로 제한되지만, LSB 6비트를 제외한 14 비트만이 오프셋으로 계산될 수 있다.② In the request sub-memory requests, the offsets of the request sub-memory requests can be calculated in the same manner as the prefetch sub-memory address in Fig. 7a. That is, the offsets in the request addresses of the request sub-memory requests other than the first request sub-memory request are limited to 20 bits, but only 14 bits excluding the
③에서, 제1 요구 서브 메모리의 요구 주소 64 비트 및 다른 요구 서브 메모리 요청들 각각의 오프셋 14비트가 결합될 수 있다. ③ In the first request
④에서, 프리로더 캐시(723)의 엔트리에 저장된 프리패치 메모리 주소가 변환된 주소 및 ③에서 결합된 주소가 비교될 수 있다. 다시 말해, 프리패치 메모리 주소와 요구 메모리 주소가 비교될 수 있다.④ In the prefetch memory address stored in the entry of the preloader cache (723), the converted address and the address combined in ③ can be compared. In other words, the prefetch memory address and the requested memory address can be compared.
⑤에서, 비교 결과 및 선택된 엔트리의 상태에 기반하여, 상태 비트가 업데이트 될 수 있다. 그리고, 비교 결과 및 선택된 엔트리에 기반하여 요구 메모리 요청이 L1 캐시(730)에 전달될 수 있다. ⑤ In the case where the status bit is updated based on the comparison result and the status of the selected entry, the request memory request can be transmitted to the L1 cache (730) based on the comparison result and the selected entry.
비교 결과 주소가 동일하고 엔트리의 상태가 이미 프리패치 요청이 생성된 상태라면, 요구 메모리 요청은 삭제되고 L1 캐시(730)로 전달되지 않을 수 있다. 다시 말해, 비교 결과 주소가 동일하고 엔트리의 상태가 이미 프리패치 요청이 생성된 상태는 프리로더 캐시(723)에 저장된 프리패치 메모리 주소가 정확히 예측되었음 의미할 수 있다. If the comparison result addresses are the same and the status of the entry is such that a prefetch request has already been generated, the requested memory request may be deleted and not forwarded to the L1 cache (730). In other words, if the comparison result addresses are the same and the status of the entry is such that a prefetch request has already been generated, this may mean that the prefetch memory address stored in the preloader cache (723) was accurately predicted.
따라서, 이 경우 ⑥에서, 프리로더 캐시(723)에서 프리패치 데이터를 LDST 유닛(710)으로 라이트 백 연산(writeback operation)을 통해 전달하면 되고, L1 캐시(730)로 요구 메모리 요청을 전달할 필요가 없을 수 있다. Therefore, in this
다만, ⑤에서 비교 결과 주소가 다른 경우, 라이트 백 연산이 수행되지 않고 요구 메모리 요청이 Ll 캐시(730)로 전달될 수 있다. However, if the addresses of the comparison results in ⑤ are different, the write back operation is not performed and the required memory request may be transferred to the Ll cache (730).
상술한 동작 이후, 엔트리의 상태는 업데이트될 수 있다. 엔트리의 상태가 업데이트되는 방법에 대해서는 도 8에서 설명하도록 하겠다.After the above-described operation, the status of the entry can be updated. The method by which the status of the entry is updated is described in Fig. 8.
도 7c는 프리패치 메모리 응답을 관리하는 방법을 설명하기 위한 도면이다.Figure 7c is a diagram illustrating a method for managing prefetch memory responses.
프리패치 메모리 요청이 프리로더 캐시(723)의 하위 캐시로 전달되었고, 그에 대한 응답으로 하위 캐시로부터 프리패치 메모리 응답이 프리로더(720)에 전달될 수 있다. 프리패치 메모리 응답은 프리패치 데이터를 포함할 수 있다. 이때, 프리패치 데이터는 프리로더 캐시(723)에 저장되거나 LDST 유닛(710)으로 우회될 수 있다.A prefetch memory request is forwarded to a lower cache of the preloader cache (723), and in response, a prefetch memory response may be forwarded from the lower cache to the preloader (720). The prefetch memory response may include prefetch data. At this time, the prefetch data may be stored in the preloader cache (723) or bypassed to the LDST unit (710).
구체적으로 ①에서, 프리로더(720)는 프리패치 메모리 요청의 자세한 정보를 가지고 있는 엔트리를 선택하기 위해 워프 ID를 이용할 수 있다. 프리로더(720)는 워프 ID를 이용하여 해당 워프 ID로 인덱싱된 엔트리를 프리로더 캐시(723)에서 선택할 수 있다. Specifically, in ①, the preloader (720) can use the warp ID to select an entry that has detailed information of a prefetch memory request. The preloader (720) can use the warp ID to select an entry indexed by the warp ID from the preloader cache (723).
②에서, 엔트리의 상태가 요구 메모리 요청이 이미 생성된 상태이고 엔트리에 저장된 프리패치 메모리 주소 및 요구 메모리 요청에 포함된 요구 메모리 주소가 일치하는지 여부를 판단할 수 있다. ② In ②, it is possible to determine whether the status of the entry is a state in which a requested memory request has already been created and whether the prefetch memory address stored in the entry and the requested memory address included in the requested memory request match.
③에서, 엔트리의 상태가 요구 메모리 요청이 이미 생성된 상태이고 엔트리에 저장된 프리패치 메모리 주소 및 요구 메모리 요청에 포함된 요구 메모리 주소가 일치는 경우, 프리패치 메모리 응답은 디멀티플렉서(demultiplexer)를 이용하여 LDST 유닛으로 라이트 백 될 수 있다. 즉, 이미 요구 메모리 요청이 생성된 경우, 프리패치 데이터는 프리로더 캐시(723)에 저장되지 않고 LDST 유닛으로 우회할 수 있다.③ In case the status of the entry is that the requested memory request has already been generated and the prefetch memory address stored in the entry and the requested memory address included in the requested memory request match, the prefetch memory response can be written back to the LDST unit using a demultiplexer. That is, if the requested memory request has already been generated, the prefetch data can be bypassed to the LDST unit without being stored in the preloader cache (723).
④에서, 엔트리의 상태가 요구 메모리 요청이 이미 생성된 상태가 아니거나 엔트리에 저장된 프리패치 메모리 주소 및 요구 메모리 요청에 포함된 요구 메모리 주소가 일치하지 않는 경우, 프리패치 메모리 응답에 포함된 프리패치 데이터는 프리로더 캐시(723)에 저장될 수 있다. 이때, 저장된 프리패치 데이터는 추후 LDST 유닛에 의해 요구 메모리 요청이 생성되었을 때 도 7b에서 설명한 방법에 따라 LDST 유닛으로 전송될 수 있다.④ In case the status of the entry is not a state in which a requested memory request has already been generated or the prefetch memory address stored in the entry and the requested memory address included in the requested memory request do not match, the prefetch data included in the prefetch memory response may be stored in the preloader cache (723). At this time, the stored prefetch data may be transmitted to the LDST unit according to the method described in Fig. 7b when a requested memory request is generated by the LDST unit later.
이하에서는, 엔트리의 상태가 프리로더(720)의 상태에 따라 업데이트되는 방법에 대해서 설명하도록 하겠다.Below, we will explain how the status of an entry is updated depending on the status of the preloader (720).
도 8은 본 개시의 일 실시예에 따른 엔트리의 상태 업데이트를 설명하기 위한 도면이다.FIG. 8 is a diagram for explaining a status update of an entry according to one embodiment of the present disclosure.
프리로더 캐시에 포함되는 엔트리들 각각은 개별적으로 5개의 상태를 가질 수 있다. 엔트리의 상태는 상태 비트로 표현될 수 있다. 상태 비트는 복수의 비트들을 포함할 수 있다. 상태 비트 중에서 하위 2 비트가 엔트리의 상태를 나타낼 수 있다. 상태 비트 중에서 하위 2 비트를 제외한 상위 비트는 복수의 서브 프리패치 메모리 요청들을 관리하는데 이용될 수 있다. 복수의 비트들 중에서 하위 2비트를 제외한 상위 비트의 개수는 복수의 서브 프리패치 메모리 요청들의 개수에 기반할 수 있다. 다시 말해, 하위 2비트를 제외한 상위 비트가 N개인 경우, 2N 개의 서브 프리패치 메모리 요청들이 관리될 수 있다. 하위 2비트를 제외한 상위 비트는 복수의 서브 프리패치 메모리 요청에 대응하는 복수의 서브 프리패치 메모리 응답이 프리로더에 도착한 개수에 따라 업데이트될 수 있다.Each of the entries included in the preloader cache can have five states individually. The state of the entry can be expressed by a state bit. The state bit can include multiple bits. The lower two bits of the state bits can represent the state of the entry. The upper bits of the state bits excluding the lower two bits can be used to manage multiple sub-prefetch memory requests. The number of the upper bits excluding the lower two bits of the multiple bits can be based on the number of multiple sub-prefetch memory requests. In other words, when the number of upper bits excluding the lower two bits is N, 2 N sub-prefetch memory requests can be managed. The upper bits excluding the lower two bits can be updated according to the number of multiple sub-prefetch memory responses corresponding to the multiple sub-prefetch memory requests that have arrived at the preloader.
이하에서는, 설명의 편의를 위해 상태 비트가 4비트인 경우를 가정하여 설명하겠다. 이때. 하위 2 비트는 엔트리의 상태를 나타낼 수 있고, 상위 2비트는 22 개의 서브 프리패치 메모리 요청들을 관리하는데 이용될 수 있다. 다만, 이하의 설명은 상태 비트가 4비트인 경우에 한정되지 않음은 통상의 기술자에게 자명하다.In the following, for the convenience of explanation, it will be explained assuming that the status bit is 4 bits. In this case, the lower 2 bits can indicate the status of the entry, and the upper 2 bits can be used to manage 2 2 sub-prefetch memory requests. However, it is obvious to those skilled in the art that the explanation below is not limited to the case where the status bit is 4 bits.
엔트리의 상태는 항상 Invalid 상태에서 시작할 수 있고, Invalid 상태에서 상태 비트는 [0 0 0 0]으로 표현될 수 있다.The state of an entry can always start in the Invalid state, and in the Invalid state, the state bits can be represented as [0 0 0 0].
①에서, 프리패치 메모리 요청이 생성되고 106 비트의 주소가 엔트리에 저장되는 경우, 엔트리의 상태는 Invalid 상태에서 Pref. Gen. 상태로 업데이트될 수 있다. Pref. Gen. 상태는 [0 0 0 1]로 표현될 수 있다. ① In case a prefetch memory request is generated and a 106-bit address is stored in the entry, the state of the entry can be updated from the Invalid state to the Pref. Gen. state. The Pref. Gen. state can be expressed as [0 0 0 1].
Pref. Gen. 상태는 프리패치 메모리 요청이 생성되었음을 나타내는 상태일 수 있다.The Pref. Gen. state may be a state indicating that a prefetch memory request has been generated.
엔트리의 상태는 Pref. Gen. 상태에서 3 가지의 상태 중 어느 하나로 업데이트될 수 있다.The state of an entry can be updated to one of three states from Pref. Gen. state.
②에서, 요구 메모리 요청이 생성되었고, 엔트리에 저장된 프리패치 데이터 주소와 요구 메모리 요청에 포함된 요구 메모리 주소가 일치하는 경우, 엔트리의 상태는 Pref. Gen. 상태에서 Dem. Gen. 으로 업데이트될 수 있다. Dem. Gen. 상태는 [# # 1 1]로 표현될 수 있다.② In ②, if a demand memory request is generated and the prefetch data address stored in the entry matches the demand memory address included in the demand memory request, the state of the entry can be updated from Pref. Gen. state to Dem. Gen. state. The Dem. Gen. state can be expressed as [# # 1 1].
여기서, 상위 2 비트는 서브 프리패치 메모리 요청에 대응하는 서브 프리패치 메모리 응답의 개수에 따라 업데이트될 수 있다. 예를 들어, 4개의 요구 서브 메모리 요청에 대응하여 2개의 요구 서브 메모리 응답만이 프리로더에 도착한 경우, 상위 2비트는 [1 0]으로 표현될 수 있다.Here, the upper two bits can be updated according to the number of sub-prefetch memory responses corresponding to the sub-prefetch memory requests. For example, if only two demand sub-memory responses arrive at the preloader in response to four demand sub-memory requests, the upper two bits can be represented as [1 0].
③에서, 요구 메모리 요청이 생성되었고, 엔트리에 저장된 프리패치 데이터 주소와 요구 메모리 요청에 포함된 요구 메모리 주소가 일치하지 않는 경우, 엔트리의 상태는 Pref. Gen. 상태에서 Miss Match 상태로 업데이트될 수 있다. Miss Match 상태는 [# # 1 0]로 표현될 수 있다.③ In case a demand memory request is generated and the prefetch data address stored in the entry does not match the demand memory address included in the demand memory request, the state of the entry can be updated from the Pref. Gen. state to the Miss Match state. The Miss Match state can be expressed as [# # 1 0].
④에서, 요구 메모리 요청이 생성되기 전에 프리패치 메모리 요청에 따른 프리패치 메모리 응답이 도착한 경우, 엔트리의 상태는 Pref. Gen. 상태에서 Pre. Data Ack. 상태로 업데이트될 수 있다. Pre. Data Ack. 상태는 [# # 0 1]로 표현될 수 있다. ④ In case a prefetch memory response arrives according to a prefetch memory request before a demand memory request is generated, the state of the entry can be updated from the Pref. Gen. state to the Pre. Data Ack. state. The Pre. Data Ack. state can be expressed as [# # 0 1].
이때. Dem. Gen. 상태, Miss Match 상태 및 Pre. Data Ack. 상태의 상위 2 비트는 복수의 서브 프리패치 메모리 요청에 대한 응답으로 프리로더에 도착한 서브 프리패치 메모리 응답의 수를 나타낼 수 있다. At this time, the upper two bits of the Dem. Gen. status, Miss Match status, and Pre. Data Ack. status may indicate the number of sub-prefetch memory responses that arrived at the preloader in response to multiple sub-prefetch memory requests.
Miss Match 상태는 프리패치 메모리 주소와 요구 메모리 주소가 일치하지 않음을 나타내는 상태일 수 있다. A Miss Match condition may indicate that the prefetch memory address and the requested memory address do not match.
따라서, ⑤에서, 서브 프리패치 메모리 요청에 따른 서브 프리패치 메모리 응답이 전부 도착하면, 엔트리의 상태는 다시 Miss Match 상태에서 Invalid 상태로 업데이트 될 수 있다. 또한, Miss Match 상태에서 요구 메모리 요청은 데이터를 로딩하기 위해 하위 캐시로 전달될 수 있다.Therefore, in ⑤, when all sub-prefetch memory responses for the sub-prefetch memory request arrive, the state of the entry can be updated from the Miss Match state to the Invalid state again. In addition, the required memory request in the Miss Match state can be forwarded to the lower cache to load the data.
Dem. Gen. 상태는 프리패치 메모리 주소와 요구 메모리 주소가 일치하는 상태를 나타낼 수 있다. 이때, 요구 메모리 주요청은 L1 캐시에 전달되지 않도록 제거될 수 있다. The Dem. Gen. state can indicate a state where the prefetch memory address matches the requested memory address. At this time, the requested memory address can be removed so as not to be delivered to the L1 cache.
⑥에서, 서브 프리패치 메모리 요청에 따른 서브 프리패치 메모리 응답이 전부 프리로더에 도착하면, 엔트리의 상태는 Dem. Gen. 상태에서 Invalid 상태로 업데이트될 수 있다. ⑥ In case all sub-prefetch memory responses according to sub-prefetch memory requests arrive at the preloader, the status of the entry can be updated from the Dem. Gen. status to the Invalid status.
Pre. Data Ack. 상태는 요구 메모리 요청이 생성되기 전에 서브 프리패치 메모리 요청에 따른 서브 프리패치 메모리 응답이 프리로더에 도착한 상태를 나타낼 수 있다. 따라서, 프리로더로 로딩된 데이터는 프리로더 캐시(즉, 엔트리)에 저장될 수 있다. Pre. Data Ack. state can indicate that a sub-prefetch memory response has arrived at the preloader for a sub-prefetch memory request before the requested memory request is generated. Accordingly, data loaded into the preloader can be stored in the preloader cache (i.e., entry).
⑦에서, 요구 메모리 요청이 생성되고, 요구 메모리 주소와 프리로더 캐시에 저장된 프리패치 메모리 주소가 일치하는 경우, 프리로더 캐시에 저장된 프리패치 데이터는 LDST 유닛으로 전달될 수 있다. 그러고 나서, 엔트리의 상태는, Pre. Data Ack. 상태에서 Dem. Gen. 상태로 업데이트될 수 있다. ⑦ In the request memory request is generated, and if the requested memory address matches the prefetch memory address stored in the preloader cache, the prefetch data stored in the preloader cache can be transferred to the LDST unit. Then, the state of the entry can be updated from the Pre. Data Ack. state to the Dem. Gen. state.
만약 ⑧에서, 요구 메모리 주소와 프리로더 캐시에 저장된 프리패치 메모리 주소가 일치하지 않는 경우, 엔트리의 상태는 Pre. Data Ack. 상태에서 Miss Match 상태로 업데이트될 수 있다. 그리고, 요구 메모리 요청은 하위 캐시로 전파될 수 있다.If in ⑧, the requested memory address does not match the prefetch memory address stored in the preloader cache, the state of the entry can be updated from the Pre. Data Ack. state to the Miss Match state. Then, the requested memory request can be propagated to the lower cache.
도 9는 본 개시의 일 실시예에 따른 전자 장치의 동작을 설명하기 위한 플로우차트이다.FIG. 9 is a flowchart for explaining the operation of an electronic device according to one embodiment of the present disclosure.
이하 실시예에서 각 동작들은 순차적으로 수행될 수도 있으나, 반드시 순차적으로 수행되는 것은 아니다. 예를 들어, 각 동작들의 순서가 변경될 수도 있으며, 적어도 두 동작들이 병렬적으로 수행될 수도 있다. 단계(901) 내지 단계(907)는 프로세서에 의해 수행될 수 있으나 실시예가 이에 한정되지 않으며 프리로더에 의해 수행될 수도 있다.In the following embodiments, the operations may be performed sequentially, but are not necessarily performed sequentially. For example, the order of the operations may be changed, and at least two operations may be performed in parallel. Steps (901) to (907) may be performed by the processor, but the embodiment is not limited thereto, and may be performed by the preloader.
단계(901)에서, 프로세서는 샘플링된 이전 요구 메모리 주소들의 보폭에 기반하여 프리패치 메모리 요청을 생성할 수 있다. At step (901), the processor may generate a prefetch memory request based on the stride of sampled previous requested memory addresses.
단계(903)에서, 프로세서는 프리패치 메모리 요청에 대한 응답인 프리패치 메모리 응답에 포함되는 프리패치 데이터 및 프리패치 데이터에 대응하는 프리패치 메모리 주소를 프리로더 캐시에 저장할 수 있다.In step (903), the processor may store prefetch data included in a prefetch memory response, which is a response to a prefetch memory request, and a prefetch memory address corresponding to the prefetch data in a preloader cache.
단계(905)에서, 프로세서는 LDST 유닛으로부터 생성된 다음 연산을 위한 요구 메모리 요청에 포함된 요구 메모리 주소 및 프리로더 캐시에 저장된 프리패치 메모리 주소가 일치하는지 여부를 판단할 수 있다.At step (905), the processor can determine whether a request memory address included in a request memory request for the next operation generated from the LDST unit and a prefetch memory address stored in the preloader cache match.
단계(907)에서, 프로세서는 요구 메모리 주소와 프리패치 메모리 주소가 일치하는 경우, 프리패치 데이터를 LDST 유닛으로 전송하고, 요구 메모리 주소와 프리패치 메모리 주소가 일치하지 않는 경우, 요구 메모리 요청을 프리로더 캐시의 하위 캐시로 전달할 수 있다.In step (907), the processor may transmit prefetch data to the LDST unit if the requested memory address and the prefetch memory address match, and may forward the requested memory request to a lower cache of the preloader cache if the requested memory address and the prefetch memory address do not match.
한편, 본 발명에 따른 방법은 컴퓨터에서 실행될 수 있는 프로그램으로 작성되어 마그네틱 저장매체, 광학적 판독 매체, 디지털 저장매체 등 다양한 기록 매체로도 구현될 수 있다.Meanwhile, the method according to the present invention can be written as a program that can be executed on a computer and can be implemented in various recording media such as a magnetic storage medium, an optical reading medium, and a digital storage medium.
본 명세서에 설명된 각종 기술들의 구현들은 디지털 전자 회로조직으로, 또는 컴퓨터 하드웨어, 펌웨어, 소프트웨어로, 또는 그들의 조합들로 구현될 수 있다. 구현들은 데이터 처리 장치, 예를 들어 프로그램가능 프로세서, 컴퓨터, 또는 다수의 컴퓨터들의 동작에 의한 처리를 위해, 또는 이 동작을 제어하기 위해, 컴퓨터 프로그램 제품, 즉 정보 캐리어, 예를 들어 기계 판독 가능 저장 장치(컴퓨터 판독가능 매체) 또는 전파 신호에서 유형적으로 구체화된 컴퓨터 프로그램으로서 구현될 수 있다. 상술한 컴퓨터 프로그램(들)과 같은 컴퓨터 프로그램은 컴파일된 또는 인터프리트된 언어들을 포함하는 임의의 형태의 프로그래밍 언어로 기록될 수 있고, 독립형 프로그램으로서 또는 모듈, 구성요소, 서브루틴, 또는 컴퓨팅 환경에서의 사용에 적절한 다른 유닛으로서 포함하는 임의의 형태로 전개될 수 있다. 컴퓨터 프로그램은 하나의 사이트에서 하나의 컴퓨터 또는 다수의 컴퓨터들 상에서 처리되도록 또는 다수의 사이트들에 걸쳐 분배되고 통신 네트워크에 의해 상호 연결되도록 전개될 수 있다.The implementations of the various technologies described herein may be implemented as digital electronic circuitry, or as computer hardware, firmware, software, or combinations thereof. The implementations may be implemented as a computer program product, i.e., a computer program tangibly embodied in an information carrier, e.g., a machine-readable storage medium (computer-readable medium) or a radio signal, for processing by the operation of a data processing device, e.g., a programmable processor, a computer, or multiple computers, or for controlling the operation thereof. A computer program, such as the computer program(s) described above, may be written in any form of programming language, including compiled or interpreted languages, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. The computer program may be deployed to be processed on one computer or multiple computers at one site, or distributed across multiple sites and interconnected by a communications network.
컴퓨터 프로그램의 처리에 적절한 프로세서들은 예로서, 범용 및 특수 목적 마이크로프로세서들 둘 다, 및 임의의 종류의 디지털 컴퓨터의 임의의 하나 이상의 프로세서들을 포함한다. 일반적으로, 프로세서는 판독 전용 메모리 또는 랜덤 액세스 메모리 또는 둘 다로부터 명령어들 및 데이터를 수신할 것이다. 컴퓨터의 요소들은 명령어들을 실행하는 적어도 하나의 프로세서 및 명령어들 및 데이터를 저장하는 하나 이상의 메모리 장치들을 포함할 수 있다. 일반적으로, 컴퓨터는 데이터를 저장하는 하나 이상의 대량 저장 장치들, 예를 들어 자기, 자기-광 디스크들, 또는 광 디스크들을 포함할 수 있거나, 이것들로부터 데이터를 수신하거나 이것들에 데이터를 송신하거나 또는 양쪽으로 되도록 결합될 수도 있다. 컴퓨터 프로그램 명령어들 및 데이터를 구체화하는데 적절한 정보 캐리어들은 예로서 반도체 메모리 장치들, 예를 들어, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(Magnetic Media), CD-ROM(Compact Disk Read Only Memory), DVD(Digital Video Disk)와 같은 광 기록 매체(Optical Media), 플롭티컬 디스크(Floptical Disk)와 같은 자기-광 매체(Magneto-Optical Media), 롬(ROM, Read Only Memory), 램(RAM, Random Access Memory), 플래시 메모리, EPROM(Erasable Programmable ROM), EEPROM(Electrically Erasable Programmable ROM) 등을 포함한다. 프로세서 및 메모리는 특수 목적 논리 회로조직에 의해 보충되거나, 이에 포함될 수 있다.Processors suitable for processing a computer program include, for example, both general-purpose and special-purpose microprocessors, and any one or more processors of any type of digital computer. Typically, the processor will receive instructions and data from a read-only memory or a random access memory or both. Elements of the computer may include at least one processor for executing instructions and one or more memory devices for storing instructions and data. Typically, the computer may include, or be coupled to receive data from, transmit data to, or both, one or more mass storage devices for storing data, such as magnetic, magneto-optical disks, or optical disks. Information carriers suitable for embodying computer program instructions and data include, by way of example, semiconductor memory devices, magnetic media such as hard disks, floppy disks, and magnetic tape, optical media such as CD-ROMs (Compact Disk Read Only Memory) and DVDs (Digital Video Disk), magneto-optical media such as floptical disks, ROMs (Read Only Memory), RAMs (Random Access Memory), flash memory, EPROMs (Erasable Programmable ROM), EEPROMs (Electrically Erasable Programmable ROM), etc. The processor and memory may be supplemented by, or included in, special purpose logic circuitry.
또한, 컴퓨터 판독가능 매체는 컴퓨터에 의해 액세스될 수 있는 임의의 가용매체일 수 있고, 컴퓨터 저장매체 및 전송매체를 모두 포함할 수 있다.Additionally, the computer-readable medium can be any available medium that can be accessed by a computer, and can include both computer storage media and transmission media.
본 명세서는 다수의 특정한 구현물의 세부사항들을 포함하지만, 이들은 어떠한 발명이나 청구 가능한 것의 범위에 대해서도 제한적인 것으로서 이해되어서는 안되며, 오히려 특정한 발명의 특정한 실시 형태에 특유할 수 있는 특징들에 대한 설명으로서 이해되어야 한다. 개별적인 실시 형태의 문맥에서 본 명세서에 기술된 특정한 특징들은 단일 실시 형태에서 조합하여 구현될 수도 있다. 반대로, 단일 실시 형태의 문맥에서 기술한 다양한 특징들 역시 개별적으로 혹은 어떠한 적절한 하위 조합으로도 복수의 실시 형태에서 구현 가능하다. 나아가, 특징들이 특정한 조합으로 동작하고 초기에 그와 같이 청구된 바와 같이 묘사될 수 있지만, 청구된 조합으로부터의 하나 이상의 특징들은 일부 경우에 그 조합으로부터 배제될 수 있으며, 그 청구된 조합은 하위 조합이나 하위 조합의 변형물로 변경될 수 있다.While this specification contains details of a number of specific implementations, these should not be construed as limitations on the scope of any invention or what may be claimed, but rather as descriptions of features that may be unique to particular embodiments of particular inventions. Certain features described herein in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented in multiple embodiments, either individually or in any suitable subcombination. Furthermore, although features may operate in a particular combination and may initially be described as being claimed as such, one or more features from a claimed combination may in some cases be excised from that combination, and the claimed combination may be modified into a subcombination or variation of a subcombination.
마찬가지로, 특정한 순서로 도면에서 동작들을 묘사하고 있지만, 이는 바람직한 결과를 얻기 위하여 도시된 그 특정한 순서나 순차적인 순서대로 그러한 동작들을 수행하여야 한다거나 모든 도시된 동작들이 수행되어야 하는 것으로 이해되어서는 안 된다. 특정한 경우, 멀티태스킹과 병렬 프로세싱이 유리할 수 있다. 또한, 상술한 실시형태의 다양한 장치 컴포넌트의 분리는 그러한 분리를 모든 실시형태에서 요구하는 것으로 이해되어서는 안되며, 설명한 프로그램 컴포넌트와 장치들은 일반적으로 단일의 소프트웨어 제품으로 함께 통합되거나 다중 소프트웨어 제품에 패키징 될 수 있다는 점을 이해하여야 한다.Likewise, although operations are depicted in the drawings in a particular order, this should not be understood to imply that the operations must be performed in the particular order illustrated or in any sequential order to achieve a desirable result, or that all of the illustrated operations must be performed. In certain cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of the various device components of the embodiments described above should not be understood to require such separation in all embodiments, and it should be understood that the program components and devices described may generally be integrated together in a single software product or packaged into multiple software products.
한편, 본 명세서와 도면에 개시된 본 발명의 실시 예들은 이해를 돕기 위해 특정 예를 제시한 것에 지나지 않으며, 본 발명의 범위를 한정하고자 하는 것은 아니다. 여기에 개시된 실시 예들 이외에도 본 발명의 기술적 사상에 바탕을 둔 다른 변형 예들이 실시 가능하다는 것은, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 자명한 것이다.Meanwhile, the embodiments of the present invention disclosed in this specification and drawings are merely specific examples presented to help understanding, and are not intended to limit the scope of the present invention. It will be apparent to those skilled in the art to which the present invention pertains that other modified examples based on the technical idea of the present invention can be implemented in addition to the embodiments disclosed herein.
Claims (20)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020230047479A KR20240151455A (en) | 2023-04-11 | 2023-04-11 | An electronic device prefetching data by predicting memory address and its operation method |
KR10-2023-0047479 | 2023-04-11 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024214878A1 true WO2024214878A1 (en) | 2024-10-17 |
Family
ID=93059544
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/KR2023/012771 WO2024214878A1 (en) | 2023-04-11 | 2023-08-29 | Electronic device for prefetching data by predicting memory address and method for operating same |
Country Status (2)
Country | Link |
---|---|
KR (1) | KR20240151455A (en) |
WO (1) | WO2024214878A1 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6976147B1 (en) * | 2003-01-21 | 2005-12-13 | Advanced Micro Devices, Inc. | Stride-based prefetch mechanism using a prediction confidence value |
US7383391B2 (en) * | 2005-05-18 | 2008-06-03 | International Business Machines Corporation | Prefetch mechanism based on page table attributes |
US20140006718A1 (en) * | 2012-06-27 | 2014-01-02 | Via Technologies, Inc. | Data prefetcher with complex stride predictor |
US20140258622A1 (en) * | 2013-03-07 | 2014-09-11 | Arm Limited | Prefetching of data and instructions in a data processing apparatus |
US20210406184A1 (en) * | 2020-06-29 | 2021-12-30 | Marvell Asia Pte Ltd | Managing prefetch requests based on stream information for previously recognized streams |
-
2023
- 2023-04-11 KR KR1020230047479A patent/KR20240151455A/en unknown
- 2023-08-29 WO PCT/KR2023/012771 patent/WO2024214878A1/en unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6976147B1 (en) * | 2003-01-21 | 2005-12-13 | Advanced Micro Devices, Inc. | Stride-based prefetch mechanism using a prediction confidence value |
US7383391B2 (en) * | 2005-05-18 | 2008-06-03 | International Business Machines Corporation | Prefetch mechanism based on page table attributes |
US20140006718A1 (en) * | 2012-06-27 | 2014-01-02 | Via Technologies, Inc. | Data prefetcher with complex stride predictor |
US20140258622A1 (en) * | 2013-03-07 | 2014-09-11 | Arm Limited | Prefetching of data and instructions in a data processing apparatus |
US20210406184A1 (en) * | 2020-06-29 | 2021-12-30 | Marvell Asia Pte Ltd | Managing prefetch requests based on stream information for previously recognized streams |
Also Published As
Publication number | Publication date |
---|---|
KR20240151455A (en) | 2024-10-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2011076120A1 (en) | High-performance cache system and method | |
WO2014000624A1 (en) | High-performance instruction cache system and method | |
US6453385B1 (en) | Cache system | |
KR100397683B1 (en) | Method and apparatus for accessing individual tags and data arrays in a load / store unit with a load buffer | |
WO2012175058A1 (en) | High-performance cache system and method | |
KR100804285B1 (en) | Translation Index Buffer Flush Filter | |
WO2017196138A2 (en) | System and method for early data pipeline lookup in large cache design | |
WO2014121737A1 (en) | Instruction processing system and method | |
WO2013071868A1 (en) | Low-miss-rate and low-miss-penalty cache system and method | |
EP0950222B1 (en) | Prefetch management in cache memory | |
WO2014185652A1 (en) | Method for replacing cache memory block having low write traffic and information processing device having cache subsystem using same | |
WO2015002481A1 (en) | Apparatus and method for managing buffer having three states on the basis of flash memory | |
WO2020246836A1 (en) | Data management device for supporting high speed artificial neural network operation by using data caching based on data locality of artificial neural network | |
WO2016148449A1 (en) | Shared resource access arbitration method, and shared resource access arbitration device and shared resource access arbitration system for performing same | |
WO2024214878A1 (en) | Electronic device for prefetching data by predicting memory address and method for operating same | |
WO2022114523A1 (en) | Memory controller that varies total limited number of commands provided to memory device, and memory thermal throttling method using same | |
WO2014000626A1 (en) | High-performance data cache system and method | |
WO2015024532A1 (en) | System and method for caching high-performance instruction | |
WO2021246818A1 (en) | Neural network processing method and device therefor | |
WO2018056614A1 (en) | Electronic apparatus, processor and control method thereof | |
WO2023080333A1 (en) | Artificial intelligence core, artificial intelligence core system, and loading/storing method of artificial intelligence core system | |
US11657003B2 (en) | Apparatus and method | |
WO2024185914A1 (en) | Vector processor and operation method thereof | |
WO2023214668A1 (en) | Instruction execution method of processor using compiler data dependency information | |
WO2017104906A1 (en) | Memory control device and operating method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23933164 Country of ref document: EP Kind code of ref document: A1 |