WO2017065379A1 - 프로세싱-인-메모리를 이용한 명령어 처리 방법 및 그 장치 - Google Patents

프로세싱-인-메모리를 이용한 명령어 처리 방법 및 그 장치 Download PDF

Info

Publication number
WO2017065379A1
WO2017065379A1 PCT/KR2016/006154 KR2016006154W WO2017065379A1 WO 2017065379 A1 WO2017065379 A1 WO 2017065379A1 KR 2016006154 W KR2016006154 W KR 2016006154W WO 2017065379 A1 WO2017065379 A1 WO 2017065379A1
Authority
WO
WIPO (PCT)
Prior art keywords
pim
cache
read
command
locality
Prior art date
Application number
PCT/KR2016/006154
Other languages
English (en)
French (fr)
Inventor
최기영
안준환
유승주
Original Assignee
삼성전자 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자 주식회사 filed Critical 삼성전자 주식회사
Priority to CN201680071578.3A priority Critical patent/CN108369507A/zh
Priority to US15/768,254 priority patent/US10860323B2/en
Publication of WO2017065379A1 publication Critical patent/WO2017065379A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • G06F9/30087Synchronisation or serialisation instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/34Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes
    • G06F9/35Indirect addressing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0811Multiuser, multiprocessor or multiprocessing cache systems with multilevel cache hierarchies
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/78Architectures of general purpose stored program computers comprising a single central processing unit
    • G06F15/7807System on chip, i.e. computer system on a single chip; System in package, i.e. computer system on one or more chips in a single package
    • G06F15/7821Tightly coupled to memory, e.g. computational memory, smart memory, processor in memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/78Architectures of general purpose stored program computers comprising a single central processing unit
    • G06F15/7839Architectures of general purpose stored program computers comprising a single central processing unit with memory
    • G06F15/7842Architectures of general purpose stored program computers comprising a single central processing unit with memory on one IC chip (single chip microcontrollers)
    • G06F15/785Architectures of general purpose stored program computers comprising a single central processing unit with memory on one IC chip (single chip microcontrollers) with decentralized control, e.g. smart memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • G06F9/30047Prefetch instructions; cache control instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • G06F9/30079Pipeline control instructions, e.g. multicycle NOP
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0815Cache consistency protocols
    • G06F12/0817Cache consistency protocols using directory methods
    • G06F12/082Associative directories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1027Address translation using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1008Correctness of operation, e.g. memory ordering

Definitions

  • the present invention relates to a method and apparatus for processing instructions using processing-in-memory (PIM).
  • PIM processing-in-memory
  • the recently proposed Hybrid Memory Cube standard includes a Processing-In-Memory (PIM) instruction that performs simple calculation in memory as part of the standard.
  • PIM Processing-In-Memory
  • Unfamiliar Program Model The proposed PIM architecture utilizes the concept of PIM as a way to implement a new type of accelerator in memory. Therefore, in order to use PIM, all existing programs must be newly implemented to utilize new accelerators, which requires a lot of effort from the programmer.
  • An object of the present invention is to provide a method and an apparatus capable of processing instructions by utilizing both a processor and a PIM according to data locality.
  • an example of an apparatus for managing a PIM may include a PIM directory including a read-write lock on a memory address accessed by an instruction; And a locality tracking unit for determining a locality of a memory address to which the instruction is accessed, and determining whether a command execution agent is a processing-in-memory (PIM) based on the locality.
  • PIM processing-in-memory
  • an example of the PIM command processing method is a read-write lock for a memory address and a PIM command processing method using locality information indicating whether data is stored in a cache. Obtaining a read-write lock on a memory address to which the instruction accesses; Determining locality of a memory address accessed by the command; And determining whether an instruction execution subject is a processing-in-memory (PIM) based on the locality.
  • PIM processing-in-memory
  • PIM can be used in a manner similar to the existing programming model:
  • the present invention makes use of in-memory computational power through new instructions in the processor.
  • the in-memory computing power can be leveraged by simply using new instructions in the existing application.
  • the present invention which accelerates data intensive applications, can be important for server processor architectures for big data analysis.
  • the current server structure which limits the performance of energy consumption, not only the system performance but also the energy consumption can be reduced, so it can be used as an important technology in server design.
  • FIG. 1 is a diagram illustrating a configuration of an embodiment for processing a PIM command according to the present invention
  • FIG. 2 is a view showing the configuration of an embodiment of a PIM management apparatus according to the present invention.
  • FIG. 3 is a diagram illustrating an embodiment of a PIM directory of a PIM management apparatus according to the present invention
  • FIG. 4 illustrates an example of a hash function for finding a read-write lock in a PIM directory.
  • FIG. 5 illustrates an example of information included in a read-write lock of a PIM directory according to the present invention
  • FIG. 6 is a view showing the configuration of an embodiment of a locality tracking unit of the PIM management apparatus according to the present invention.
  • FIG. 7 is a diagram illustrating an example of information stored in each tag of the locality tracking unit according to the present invention.
  • FIG. 8 is a diagram illustrating a configuration of another embodiment for processing a PIM command according to the present invention.
  • FIG. 9 and 10 illustrate a method of processing an instruction using a PIM based on the structure of FIG. 8 according to the present invention
  • FIG. 11 is a diagram illustrating an example of a method for maintaining consistency between a PIM executable instruction and a general instruction according to the present invention
  • FIG. 12 is a diagram illustrating an example of a system configuration for simulation of a command processing method using a PIM according to the present invention
  • PIM Processing-In-Memory
  • FIG. 1 is a diagram illustrating a configuration of an embodiment for processing a PIM command according to the present invention.
  • the processor 150 includes at least one or more cores 110, at least one or more caches 120, and a PIM management device 100.
  • the processor 150 may be implemented in various forms such as a central processing unit (CPU) or a graphic processing unit (GPU).
  • the PIM management apparatus 100 may be implemented within the processor 150 or may be implemented separately from the portion 140 including the core 110 and the cache 120. In another embodiment, the PIM management apparatus 100 may be implemented as a part of the core 110 or the cache 120. This embodiment corresponds to one embodiment for processing a PIM command and a hardware structure is not necessarily limited to this embodiment.
  • Processing-in-memory (PIM) 130 is a memory capable of executing instructions on its own, and its implementation may vary.
  • the PIM may be implemented with 3D-stacked DRAM (DRAM), Double Data Rate 3/4 (DDR3 / 4), or the like.
  • an instruction that can be executed in the PIM 130 and an instruction that cannot be executed in the PIM 130 may exist.
  • an instruction that can be executed in the PIM is called a PIM-enabled instruction, and other instructions are called a normal instruction.
  • General instructions are executed to the processor according to conventional methods.
  • the PIM management apparatus 100 determines whether to process the PEI in the processor 150 or the PIM 130 based on the locality of the data accessed by the PEI.
  • the term "locality" refers to the degree to which data is frequently used, and can be said to be highly localized when the same data is repeatedly used in a short time or when several nearby data are accessed in a short time.
  • a cache is configured to store highly localized data, so that highly localized data is more likely to be stored in the cache, and less localized data is more likely to be stored in memory rather than in the cache. Therefore, the PIM management apparatus allows the core 110 to execute a command by using the cache 120 when the locality of data accessed by the PEI is high, and when the locality is low, the PIM 130 utilizes the data stored in the memory. To perform.
  • the PIM management apparatus 100 may determine that data having a high number of uses or a high frequency of use has a high locality, and that data having a low use frequency or a low use frequency has low locality. In this case, the PIM management apparatus 100 may determine that the processor 150 processes the PEI that intends to use data having a locality greater than or equal to a threshold, and may determine that the PEI that intends to use data having a locality less than a threshold is processed by the PIM 130.
  • the locality of the data can be expressed differently as the locality of the memory address where the data is stored. Accordingly, the PIM management apparatus 100 may determine that a memory address having a high number of accesses of a command or a high access frequency of a command for a predetermined time interval has a high locality, and a memory address having a low number of accesses or a low access frequency has a low locality. Can be.
  • the PIM management apparatus 100 determines that the PEI is processed by the processor 150 by determining that the locality of the corresponding data is high when the latest version of the data to be used when executing the PEI is stored in the cache. If the latest version of is stored in the memory, it may be determined that the locality of the corresponding data is low, so that the PEI 130 may process the PEI.
  • the PIM management apparatus 100 tracks data locality of the PEI by using information of cache blocks accessed by the PEI.
  • the PIM management apparatus 100 may track locality by using the same or similar information as the tag array including information about the memory address of the data stored in the cache. For example, the PIM management apparatus 100 determines the locality of the data accessed by the PEI through the tag array stored in the cache, or locally stores the same or similar information as the tag array of the cache in the PIM management apparatus 100 by itself. Can manage.
  • FIGS. 2 to 5 Various embodiments of the PIM management apparatus 100 are illustrated in FIGS. 2 to 5.
  • the determination of the subject of execution of the PEI is not determined by software such as an application, but is determined by the PIM management apparatus 100 according to the locality of the data accessed by the PEI. You don't have to worry about it, just develop your application according to the existing programming model.
  • PEI Since PEI is performed on a processor or PIM based on locality, problems may arise in the coherence between the cache and the data stored in memory. For example, when PEI is performed on PIM 130, the latest version of data may be present in cache 120 and previous data may be present in PIM 130. Conversely, when the PEI or general instruction is executed in the processor 150, the latest data may be present in the PIM 130 and the previous data may exist in the cache 120. In order to solve this problem, the PIM management apparatus 100 may request that the data stored in the cache 120 be reflected in a memory before delivering the PEI to the PIM 130 when the subject of the PEI is the PIM 130.
  • a writeback request (in case of PEI of a read operation) or an invalidation request (in case of PEI of a write operation) of data stored in the cache 120 is transmitted to the cache 120.
  • the latest data stored in the cache 120 is reflected in the PIM, or invalidation of the data stored in the cache is performed, thereby satisfying cache coherency.
  • the same memory address may be simultaneously accessed.
  • the first PEI performs an operation of reading or writing data of the first memory address
  • the second PEI should be prevented from accessing the first memory address and changing the data.
  • Insuring that an instruction (PEI or generic instruction) is not interrupted by another instruction (PEI or generic instruction) is called guaranteeing atomicity of the instruction.
  • the PIM management apparatus 100 stores and manages a lock on a memory address accessed by the PEI so that the PEI can be performed after obtaining the lock.
  • the first PEI when the first PEI intends to perform a read or write operation on the first memory address, the first PEI acquires a lock on the first memory address from the PIM management apparatus. The first PEI is performed after acquiring the lock.
  • the second PEI intends to perform a read or write operation on the first memory address, since the first PEI has a lock, the second PEI is in a waiting state until the lock is released.
  • the atomicity between the PEI and the general instructions as well as the atomicity between the PEIs must be ensured, as will be explained in FIG.
  • PEI can use a virtual memory address as a regular instruction. This eliminates the need to change existing operating systems or applications to support PEI's virtual memory. For example, the virtual memory address of the PEI is changed to a physical address using a translation lookaside buffer (TLB) existing in an existing processor, and then the processor or the processor according to the performing entity determined by the PIM management apparatus 100. PEI is performed in PIM.
  • TLB translation lookaside buffer
  • FIG. 2 is a diagram illustrating a configuration of an embodiment of a PIM management apparatus according to the present invention.
  • the PIM management apparatus 100 includes a PIM directory 200 and a locality tracking unit 210.
  • PIM directory 200 includes a reader-writer lock on the memory address each PEI accesses to ensure atomicity between PEIs.
  • the PIM directory 200 may include a read-write lock for every memory address accessible by the PEI.
  • the total number of read-write locks included in the PIM directory 200 is equal to the main memory size (ie, the memory size of the PIM) as the size of the cache block. It may be less than the divided value.
  • the PIM directory 200 may store a predetermined number of read-write locks to reduce the storage space of the read-write locks.
  • different memory addresses may share a single read-write lock, but there is no problem with atomicity between PEIs. This will be described again with reference to FIG. 3.
  • the locality tracking unit 210 manages locality information for determining whether the PEI is performed by the processor or the PIM. In the case of high locality, it is advantageous to utilize the cache, so the PEI is performed on the processor. In the case of low locality, the PEI is performed in memory.
  • the locality tracking unit 210 is composed of a tag array including information on memory addresses of data accessed by the PEI.
  • the tag included in the locality tracking unit 210 may be the same as or similar to the tag of the cache 120.
  • An example of a tag is shown in FIGS. 6 and 7.
  • FIG. 3 is a diagram illustrating an embodiment of a PIM directory of the PIM management apparatus according to the present invention
  • FIG. 4 is a diagram illustrating an example of a hash function for finding a read-write lock in the PIM directory.
  • the PIM directory includes an array 310 including a plurality of entries 320 of read-write locks.
  • the PIM directory may include a certain number (N) read-write locks to reduce the size of the storage space of the read-write lock entry 320.
  • N the number of the memory address accessed by the PEI and the read-write lock of the PIM directory do not have a one-to-one correspondence.
  • a plurality of memory addresses may correspond to one read-write lock.
  • the first memory address and the second memory address are one read-write. Share the lock. Therefore, although the first PEI accessing the first memory address and the second PEI accessing the second memory address access different memory addresses, if the first PEI first acquires a read-write lock, the second PEI Wait until the lock acquired by the first PEI is released.
  • the method of finding a read-write lock for each memory address may be various. For example, as shown in FIG. 4, a read-write lock for a memory address in a PIM directory may be found using XOR as a hash function.
  • the memory address 400 accessed by the PEI is split in log 2 N-bit units, and XORs all pieces (410, 420, 430, 440) to log. Create an address Y of 2 N-bits.
  • the Yth read-write lock in the PIM directory is used as the lock for the PEI.
  • FIG. 5 is a diagram illustrating an example of information included in a read-write lock of a PIM directory according to the present invention.
  • each read-write lock entry 320 includes a write lock field 500, a read lock field 510, a read-counter field 520, and a write-counter field 530.
  • the write lock field 500 indicates whether the PEI has set a lock for a write operation.
  • the write lock field 500 may be configured with 1 bit, and if it is '1', it may indicate a lock setting and if it is '0', it may indicate a lock release.
  • the read lock field 510 indicates to PEI whether a lock for a read operation is set.
  • the read lock field 510 may be configured with 1 bit and indicate a lock setting when '1' is set and a lock release when '0' is set.
  • the read-counter field 520 indicates the number of read locks set. When a plurality of PEIs perform only read operations on the same memory address, there is no change in data, and thus, a plurality of PEIs may be performed simultaneously. For example, if the first PEI acquires the lock for the read operation on the first memory address, the read-counter field 520 of the read-write lock for the first memory address becomes one. If the second PEI acquires the lock for the read operation again on the first memory address before completion of the first PEI, the read-counter field 520 becomes two. The first and second PEIs that acquire the lock may be simultaneously executed. The value of the read-counter field 520 increases until the maximum allowed number of read locks is reached. If the maximum allowed number of read locks is exceeded, the PEI must wait until the locks are released.
  • the write-counter field 530 indicates the number of write locks set. Unlike a read lock, a write lock does not allow a case where a plurality of PEIs perform a write operation or a case where a plurality of PEIs perform a read and write operation.
  • FIG. 6 is a diagram illustrating a configuration of an embodiment of a locality tracking unit of the PIM management apparatus according to the present invention.
  • the locality tracking unit 210 includes a tag array 600.
  • Each tag 610 indicates whether data for the memory address that the PEI accesses exists in the cache.
  • the tag array 600 of the locality tracking unit 210 may be the same or similar to the tag array of the cache 120.
  • An example of information included in the tag array of the locality tracking unit 210 is illustrated in FIG. 7.
  • the locality tracking unit 210 classifies and stores each tag 610 as a hash value for a memory address. Accordingly, when determining the locality of the memory address that the PEI accesses, the locality tracking unit 210 determines whether the locality is high based on whether a tag corresponding to the hash value of the memory address exists.
  • the hash function 620 for obtaining a hash value for the memory address is various. For example, as shown in FIG. 4, the memory address may be divided into a plurality of groups, and a value obtained by XOR for each group may be obtained as a hash value.
  • the tag array 600 of the locality tracking unit 210 is updated not only every time the PEI accesses the cache, but also when there is access to the corresponding cache block even when the PEI is performed in the PIM 130.
  • the update means that each tag 610 is replaced or updated in the locality tracking unit 210 according to the cache block replacement algorithm of the cache in the same manner as the cache block is replaced or updated in the tag array of the cache 120.
  • the locality of the data is not known.
  • updating the locality tracking unit 210 indicates that the data has high locality since the record remains in the locality tracking unit 210 when several PEIs access an address in the same memory. have.
  • FIG. 7 is a diagram illustrating an example of information stored in each tag of the locality tracking unit according to the present invention.
  • each tag 610 stored in the locality tracking unit 210 includes a valid bit field 700, a cache tag field 710, an update information field 720, and the like.
  • the valid bit 700 indicates whether data stored in the cache is valid.
  • the cache tag field 710 includes information stored in a tag of a cache or part of information.
  • the cache tag field 710 may include a value obtained by hashing a memory address stored in a tag of the cache 120 as shown in FIG. 4.
  • the replacement information field 720 includes information for replacing data stored in the cache. For example, when new data is to be stored in the cache, the oldest referenced data is deleted. At this time, the oldest referenced data is identified using the update information field 720.
  • FIG. 8 is a diagram showing the configuration of another embodiment for processing a PIM command according to the present invention.
  • the core 110 includes a first core 112 and a PCI (PEI Computation Unit) 114, and the cache 120 includes an L1 cache 122, an L2 cache 124, and an LL cache. 126, and the like.
  • the cache 120 includes a memory controller 800 for transmitting and receiving data with the PIM.
  • the PIM 130 also includes a crossbar network 810, a plurality of DRAM controllers 820, 830, 840, and a plurality of PCUs 822, 832, 842.
  • PIM can be implemented in various forms.
  • the data size of the memory address accessed by the PEI may be larger than the size of the cache block.
  • the PIM 130 further needs a configuration for managing a mapping relationship between data in order to perform the PEI. Therefore, when the PIM supports data larger than the cache block size, the data size of the memory address accessed by the PEI may be unlimited.
  • the size of data accessed by the PEI is one cache block. In other words, it is assumed that the PEI performs a write operation or a read operation on one cache block, or a simultaneous operation of writing and reading.
  • the PIM management apparatus 100 is connected to the LL cache 126 in this embodiment. If the LL cache 126 does not contain information about the L1 cache 122 or the L2 cache 124, the PIM management apparatus 100 is the L1 cache 122, L2 cache 124, LL cache ( 126) may be connected to each other to perform an operation according to the present embodiment.
  • the core 110 may not read the latest version of the data through the cache 120 when the previous version of the data remains in the cache. Accordingly, before the PEI including the write operation is sent to the PIM 130, the PIM management apparatus 100 sends an invalidation request for the target cache block to the LL cache 126. Receiving this request invalidates the cache block in all caches 122, 124, and 126 of the processor. Implementation methods for this may vary, and if the cache 120 is an inclusive cache hierarchy, the existing back-invalidation request may be used as it is. This ensures cache coherency by preventing changed data in the PIM from being obscured by data remaining in the cache.
  • the PIM management apparatus 100 sends a request to the LL cache 126 to reflect the data of the cache 120 in the memory.
  • the LL cache 126 receives this request, if the data remains in the changed state, the LL cache 126 changes it to a clean state and writes the latest data to the memory 130. If the PEI is performed later, since the latest data is reflected in the PIM 130, cache coherency is maintained.
  • a given virtual memory address is translated into a physical address before each PEI is started.
  • TLB can be used for address translation.
  • the virtual address is fully supported for the PEI since the physical address is always used regardless of the location where the PEI is performed later.
  • virtual memory for the PIM 130 can be supported without putting a memory management unit (MMU) in the memory.
  • MMU memory management unit
  • This embodiment unlike FIG. 1, includes the PCUs 114, 822, 832, and 842 in the processor 150 and the PMI 130, respectively.
  • the PEI since there are PCUs 822, 832 and 842 for each DRAM, the PEI preferably reads and writes data in units of one cache block.
  • the structure of the PCUs 114, 822, 832, and 842 may vary depending on the kind of operations supported.
  • the processor-side PCU 114 may be implemented in any form as long as it is a device capable of reading and computing data from the cache 120 and writing data to the cache if necessary.
  • the processor-side PCU 114 is shown to help understand the present embodiment, and the processor-side PCU 114 may be modified in various forms according to the embodiment, such as being implemented as a part of the core or implemented in software.
  • FIG. 9 and 10 are diagrams illustrating a command processing method using a PIM according to the present invention based on the structure of FIG. 8.
  • PEI is an instruction for performing an operation of 'x + y'
  • y is an operand received through a core
  • x is an operand stored in a cache or memory.
  • PEI is performed at the processor side.
  • the core 112 transmits an operand y of the PEI to the PCU 114 (S900).
  • the PCU 114 may convert a virtual memory address to be accessed by the PEI into a physical memory address using a translation lookaside buffer (TLB).
  • TLB translation lookaside buffer
  • the PIM management apparatus 100 provides the PEI with a read-write lock on the operand x, and checks the locality of the operand x (S910). The PIM management apparatus 100 determines whether the execution agent of the PEI is the processor 150 or the PIM 130 based on the locality (S920). In the present embodiment, it is assumed that the processor 150 is determined to perform PEI due to high locality.
  • PCU 114 reads data of operand x from L1 cache 122 (S930). Perform PEI (S940). If it is necessary to store the data in the cache 120, the data is stored in the cache 120 (for example, a result of x + y) (S950). When the PEI is completed, the PCU 114 notifies the PIM management apparatus 100 that the PEI is completed (S960). The PIM management device 100 then releases the read-write lock provided to the PEI. The PCU 114 provides the PEI result value to the core 112 (S970).
  • the PEI is performed in the PIM.
  • the core 112 transmits the operand y of the PEI to the PCU 114 (S1000).
  • the PCU 114 may convert a virtual memory address to be accessed by the PEI into a physical memory address using a translation lookaside buffer (TLB).
  • TLB translation lookaside buffer
  • the PCU 114 acquires a read-write lock on the operand x from the PIM management apparatus 100 and checks the locality of the operand x (S1005).
  • the PIM management apparatus 100 determines whether the subject of execution of the PEI is a processor or a PIM based on locality (S1010). This embodiment assumes that locality is low and the subject of PEI is determined to be PIM.
  • the PIM management apparatus 100 When the PEI performs only a read operation, the PIM management apparatus 100 sends a back-writeback request to the LL cache 126 (S1015), and the data to be accessed by the PEI is present in the cache. Write this back to main memory. When the PEI reads and writes the data, the PIM management apparatus 100 sends a back-invalidation request to the LL cache 126 (S1015) to discard all the data to be accessed by the PEI in the cache 120. .
  • the PCU 114 transmits the operand y to the PIM management apparatus 100 (S1020), and the PIM management apparatus 100 transmits the operand y and PEI to the PIM 130 (S1025).
  • the PIM management apparatus 100 receives the result value from the PIM 130 (S1030), it transmits it to the core 112 through the PCU 114 (S1035, S1040), and releases the read-write lock set to the PEI. do.
  • FIG. 11 is a diagram illustrating an example of a method for maintaining consistency between a PIM executable instruction and a general instruction according to the present invention.
  • a new function is introduced to maintain consistency between PEI and general instructions.
  • the function is denoted by pfence ().
  • the processor determines (1120) the PEI being executed before the pfence (). For example, when the PEI obtained the lock through the PIM directory of the PIM management apparatus is the first and second PEIs 1100 and 1105, the processor completes the execution of the first and second PEIs 1100 and 1105. Wait for normal commands to be executed.
  • the processor executes a general instruction. . Since the third PEI 1110 is performed after pfence (), the general instruction is performed regardless of whether the third PEI is completed.
  • FIG. 12 is a diagram illustrating an example of a system configuration for simulation of a command processing method using a PIM according to the present invention, and FIGS. 13 and 14 illustrate simulation results through the system of FIG. 12.
  • the method according to the invention shows the same performance as performing all PEIs in memory when the input data is large (Fig. 13 (c)) (average 47% performance improvement compared to when all the processors do), and when the input data is small (FIG. 13A) shows the same performance as performing all PEIs with a processor.
  • the present invention shows an average performance improvement of 32% compared to the case where the PMI is performed.
  • the input size is medium (FIG. 13 (b)) since both the performance in the processor and the performance in the PIM are used, the performance is improved compared to using only one of them.
  • the present invention exhibits excellent performance even in energy consumption evaluation.
  • the present invention can be seen that the energy consumption is less than the conventional regardless of the size of the input data.
  • energy consumption is less than that performed in the processor and the PIM.
  • the invention can also be embodied as computer readable code on a computer readable recording medium.
  • the computer-readable recording medium includes all kinds of recording devices in which data that can be read by a computer system is stored. Examples of computer-readable recording media include ROM, RAM, CD-ROM, magnetic tape, floppy disks, optical data storage devices, and the like.
  • the computer readable recording medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

프로세싱-인-메모리를 이용한 명령어 처리 방법 및 그 장치가 개시된다. PIM 관리장치는 명령어가 액세스하는 메모리 주소에 대한 읽기-쓰기 락(lock)을 포함하는 PIM 디렉토리 및 명령어가 액세스하는 메모리 주소에 대한 지역성을 파악하고, 상기 지역성을 기초로 명령어의 수행 주체가 프로세싱-인-메모리(PIM)인지 결정하는 지역성 추적부를 포함한다.

Description

프로세싱-인-메모리를 이용한 명령어 처리 방법 및 그 장치
본 발명은 프로세싱-인-메모리(PIM)를 이용한 명령어 처리 방법 및 그 장치에 관한 것이다.
최근 프로세서의 성능 향상이 메모리 성능의 병목으로 인해 둔화되는 경향을 보이고 있다. 특히 메모리 벽(Memory Wall)이라고 불리는 메모리 대역폭 제한으로 인해 프로세서가 계산을 빨리하여도 메모리에서 데이터를 가져오는 시간이 오래 걸려 전체 성능이 저하되는 현상을 나타내는 데이터 집약적인 애플리케이션이 많아 지고 있다. 따라서 이를 해결하기 위하여 최근 제안된 Hybrid Memory Cube 표준 등에서는 메모리 안에서 간단한 계산을 수행하는 Processing-In-Memory(PIM) 명령어를 표준의 일부로 포함하고 있다. 그러나 이러한 PIM 구조는 다음과 같은 문제점을 가지고 있다.
1. 익숙하지 않은 프로그램 모델: 종래 제안된 PIM 구조는 모두 새로운 종류의 가속기(accelerator)를 메모리 안에 구현하는 방법으로 PIM 개념을 활용하였다. 따라서 PIM을 활용하기 위해서는 기존의 프로그램을 모두 새로운 가속기를 활용할 수 있도록 새로 구현해야 하므로, 프로그래머의 많은 노력을 필요로 한다.
2. 기존 시스템의 캐시 및 가상 메모리(Virtual Memory)와 낮은 호환성: 기존 PIM 구조는 메모리에 저장되어 있는 값을 메모리에 안에서 읽고 쓰는 연산이 필수로 동반된다. 그러나 프로세서는 이러한 동작을 확인할 수 없으므로 다음의 두 가지 문제가 발생한다. 첫째, 프로세서의 캐시가 가지고 있는 데이터가 메모리 안에서 변경될 경우 캐시의 값이 최신의 것이 아니므로 데이터의 일관성(coherence)에 문제가 생긴다. 동일한 이유로 캐시에 있는 데이터가 수정될 경우 메모리에서 이를 알 수 없는 문제가 발생한다. 둘째, 가상 메모리 주소변환은 모두 프로세서에서 수행되므로 메모리 안의 가속기는 가상 메모리 주소를 사용할 수 없다. 정리하면, 기존의 PIM 구조는 캐시 및 가상 메모리와 호환되지 않으므로, 메모리 안 가속기가 접근할 수 있는 메모리 영역을 단순히 캐시 불가능(non-cacheable)하게 하고 물리 메모리 주소로만 접근(physically-addressed)하는 방법을 사용했다. 이는 기존 애플리케이션을 PIM 구조가 사용 가능하게 수정하는데 많은 노력이 들게 한다.
3. 메모리 접근 지역성(locality) 고려 부재: 기존 PIM 구조는 특정 계산을 항상 메모리 안 가속기를 활용하는 방식으로 되어 있다. 그러나 입력의 크기가 작을 경우 입력 데이터가 프로세서의 캐시 안에 모두 들어갈 수 있고, 이 경우 캐시에서 데이터를 읽어오는 것이 메모리에서 읽어 오는 것보다 효율적이므로 메모리 안 가속기가 기존 프로세서 구조보다 성능이 떨어질 수 있다.
본 발명이 이루고자 하는 기술적 과제는, 데이터 지역성에 따라 프로세서와 PIM을 모두 활용하여 명령어를 처리할 수 있는 방법 및 그 장치를 제공하는 데 있다.
상기의 기술적 과제를 달성하기 위한, 본 발명에 따른 PIM 관리 장치의 일 예는, 명령어가 액세스하는 메모리 주소에 대한 읽기-쓰기 락(lock)을 포함하는 PIM 디렉토리; 및 명령어가 액세스하는 메모리 주소에 대한 지역성을 파악하고, 상기 지역성을 기초로 명령어의 수행 주체가 프로세싱-인-메모리(PIM)인지 결정하는 지역성 추적부;를 포함한다.
상기의 기술적 과제를 달성하기 위한, 본 발명에 따른 PIM 명령어 처리 방법의 일 예는, 메모리 주소에 대한 읽기-쓰기 락 및 캐시에 데이터가 저장되어 있는지 여부를 나타내는 지역성 정보를 이용한 PIM 명령어 처리 방법에 있어서, 명령어가 액세스하는 메모리 주소에 대한 읽기-쓰기 락을 획득하는 단계; 상기 명령어가 액세스하는 메모리 주소의 지역성을 파악하는 단계; 및 상기 지역성을 기초로 명령어의 수행 주체가 프로세싱-인-메모리(PIM)인지 결정하는 단계;를 포함한다.
본 발명에 따르면, 다음과 같은 효과를 가진다.
1. 기존 프로그래밍 모델과 유사한 방법으로 PIM 사용 가능: 본 발명은 메모리 안 계산 능력을 프로세서의 새로운 명령어(instruction)를 통해 활용 가능하다. 따라서 기존의 PIM 구조에서 새로운 메모리 안 가속기의 프로그래밍 모델에 맞게 기존 애플리케이션을 새로 개발해야 했던 것과 달리, 기존 애플리케이션에서 새로운 명령어를 사용하기만 하면 메모리 안의 계산 능력을 활용할 수 있다.
2. 기존 캐시 일관성 관리 및 가상 메모리 기술 지원 가능: 종래 PIM 구조는 시스템에 존재하는 캐시 일관성(cache coherence) 및 가상 메모리 관리기술과 호환되지 않기 때문에 이들을 비활성화하고 사용해야 한다. 그러나 본 발명은 캐시 일관성과 가상 메모리 주소변환을 프로세서가 수행한 후 메모리에 보내주는 방법을 통해 기존 시스템에 존재하는 캐시 일관성 관리 및 가상 메모리 기술을 그대로 지원할 수 있다.
3. 메모리 접근 지역성을 고려한 선택적 PIM 사용: 기존 PIM 구조는 특정 계산에 대해 PIM을 사용하도록 애플리케이션을 개발하면 해당 부분에서는 항상 메모리에서 계산하는 방법을 사용하였다. 이러한 종래 방법은 입력 크기에 따라 데이터의 지역성이 달라지는 경우, 입력 크기가 작은 수행에 대해 프로세서의 캐시를 활용할 수 없는 단점을 가진다. 그러나 본 발명의 구조는 PIM 명령어가 접근하는 캐시 블록의 지역성을 하드웨어가 추적하고, 이를 바탕으로 메모리 지역성이 낮은 PIM 명령어만 메모리에서 수행하고, 메모리 지역성이 높은 PIM 명령어는 캐시를 활용하기 위하여 프로세서에 수행할 수 있다. 이를 통해 서로 다른 입력 크기에서도 항상 기존 프로세서 구조와 PIM 구조의 장점만을 살릴 수 있다.
4. 이 외에도, 메모리 대역폭에 성능이 제한되는 데이터 집약적인 애플리케이션의 속도를 가속할 수 있다. 기하급수적으로 빠르게 증가하는 데이터를 분석해야 하는 빅데이터 애플리케이션의 중요성이 커지는 최근 경향을 고려할 때, 데이터 집약적인 애플리케이션을 가속하는 본 발명은 빅 데이터 분석을 위한 서버 프로세서 구조에 중요하게 사용될 수 있다. 특히 에너지 소모에 성능이 제한되기도 하는 현재 서버 구조의 관점에서 봤을 때, 시스템 성능뿐만 아니라 에너지 소모를 줄일 수 있어 서버를 설계하는데 중요한 기술로 사용될 수 있다.
도 1은 본 발명에 따른 PIM 명령어 처리를 위한 일 실시 예의 구성을 도시한 도면,
도 2는 본 발명에 따른 PIM 관리장치의 일 실시 예의 구성을 도시한 도면,
도 3은 본 발명에 따른 PIM 관리장치의 PIM 디렉토리의 일 실시 예를 도시한 도면,
도 4는 PIM 디렉토리 내 읽기-쓰기 락을 찾기 위한 해시 함수의 일 예를 도시한 도면,
도 5는 본 발명에 따른 PIM 디렉토리의 읽기-쓰기 락에 포함되는 정보의 일 예를 도시한 도면,
도 6은 본 발명에 따른 PIM 관리장치의 지역성 추적부의 일 실시 예의 구성을 도시한 도면,
도 7은 본 발명에 따른 지역성 추적부의 각 태그에 저장되는 정보의 일 예를 도시한 도면,
도 8은 본 발명에 따른 PIM 명령어 처리를 위한 다른 실시 예의 구성을 도시한 도면,
도 9 및 도 10은 본 발명에 따른 PIM을 이용한 명령어 처리 방법을 도 8의 구조를 기초로 도시한 도면,
도 11은 본 발명에 따른 PIM 수행 가능 명령어와 일반 명령어 사이의 일관성을 유지하는 방법의 일 예를 도시한 도면,
도 12는 본 발명에 따른 PIM을 이용한 명령어 처리 방법의 시뮬레이션을 위한 시스템 구성의 일 예를 도시한 도면, 그리고,
도 13 및 도 14는 도 12의 시스템을 통한 시뮬레이션 결과를 도시한 도면이다.
이하에서, 첨부된 도면들을 참조하여 본 발명에 따른 프로세싱-인-메모리(Processing-In-Memory, PIM)를 이용한 명령어 처리 방법 및 그 장치에 대해 상세히 설명한다.
도 1은 본 발명에 따른 PIM 명령어 처리를 위한 일 실시 예의 구성을 도시한 도면이다.
도 1을 참조하면, 프로세서(150)는 적어도 하나 이상의 코어(core)(110), 적어도 하나 이상의 캐시(cache)(120) 및 PIM 관리장치(100)를 포함한다. 프로세서(150)는 CPU(Central processing unit) 또는 GPU(graphic processing unit) 등 다양한 형태로 구현될 수 있다. PIM 관리장치(100)는 프로세서(150) 내에 구현되거나 코어(110) 및 캐시(120)를 포함하는 부분(140)과 별개로 구현될 수 있다. 또 다른 실시 예로, PIM 관리장치(100)는 코어(110) 또는 캐시(120)의 일부 구성으로 구현될 수 있다. 본 실시 예는 PIM 명령어 처리를 위한 하나의 실시 예에 해당하며 하드웨어 구조가 반드시 본 실시 예에 한정되는 것은 아니다.
프로세싱-인-메모리(PIM)(130)는 명령어를 자체에서 수행할 수 있는 메모리로서 그 구현 형태는 다양할 수 있다. 예를 들어, PIM은 3차원-적층 DRAM(3D-stacked DRAM), DDR3/4(Double Data Rate 3/4) 등으로 구현될 수 있다.
일반적으로 PIM(130)에서 수행 가능한 명령어와 PIM(130)에서 수행 불가능한 명령어가 존재할 수 있다. 이하에서는 설명의 편의를 위하여 PIM에서 수행 가능한 명령어를 PEI(PIM-enabled instruction)라고 하고, 그 외 명령어를 일반 명령어(normal instruction)라고 한다. 일반 명령어는 종래의 방법에 따라 프로세서에 수행된다.
PIM 관리장치(100)는 PEI가 접근하는 데이터의 지역성(locality)을 기초로 PEI를 프로세서(150)에서 처리할지 아니면 PIM(130)에서 처리할지 결정한다. 여기서 지역성이라고 함은 데이터가 자주 사용되는 정도를 나타내는 것으로, 같은 데이터가 짧은 시간 안에 반복적으로 사용되거나 공간적으로 근처에 있는 여러 데이터가 짧은 시간 안에 접근되는 경우 지역성이 높다고 할 수 있다. 일반적으로 캐시는 지역성이 높은 데이터를 저장하도록 구성되며, 따라서 지역성이 높은 데이터는 캐시에 저장되어 있을 확률이 높고 지역성이 낮은 데이터는 캐시가 아닌 메모리에 저장되어 있을 확률이 높다. 따라서, PIM 관리장치는 PEI가 접근하는 데이터의 지역성이 높으면 코어(110)가 캐시(120)를 활용하여 명령어를 수행하도록 하고, 지역성이 낮으면 PIM(130)이 메모리에 저장된 데이터를 활용하여 명령어를 수행하도록 한다.
일 예로써, PIM 관리장치(100)는 사용 횟수가 많거나 사용 빈도가 높은 데이터는 지역성이 높고, 사용 횟수가 적거나 사용 빈도가 낮은 데이터는 지역성이 낮은 것으로 판단할 수 있다. 이 경우, PIM 관리장치(100)는 지역성이 임계치 이상인 데이터를 사용하려는 PEI를 프로세서(150)에서 처리하도록 결정하고, 지역성이 임계치 미만인 데이터를 사용하려는 PEI는 PIM(130)에서 처리하도록 결정할 수 있다
데이터의 지역성은 해당 데이터가 저장된 메모리 주소의 지역성으로 달리 표현될 수 있다. 따라서 PIM 관리장치(100)는 명령어의 접근 횟수가 많거나 일정 시간 구간 동안에 명령어의 접근 빈도가 높은 메모리 주소는 지역성이 높고, 접근 횟수가 적거나 접근 빈도가 낮은 메모리 주소는 지역성이 낮은 것으로 판단할 수 있다.
다른 예로써, PIM 관리장치(100)는 PEI 실행 시 사용할 데이터의 최신 버전이 캐시에 저장되어 있는 경우, 해당 데이터의 지역성이 높은 것으로 판단하여 PEI를 프로세서(150)에서 처리하도록 결정하고, 사용할 데이터의 최신 버전이 메모리에 저장되어 있는 경우 해당 데이터의 지역성이 낮은 것으로 판단하여 PEI를 PIM(130)에서 처리하도록 결정할 수 있다.
이 밖에도, 앞서 언급된 지역성 판단 조건들의 조합을 통해 지역성을 판단하거나 다른 조건을 추가적으로 사용하여 지역성을 판단하는 것도 가능하며, 지역성에 대한 앞선 설명은 실시예이므로 본 발명이 이에 한정되는 것은 아니다.
PIM 관리장치(100)는 PEI가 접근하는 캐시 블록의 정보를 이용하여 PEI의 데이터 지역성을 추적한다. PIM 관리장치(100)는 캐시에 저장된 데이터의 메모리 주소에 대한 정보를 포함하는 태그 어레이와 동일 또는 유사한 정보를 이용하여 지역성을 추적할 수 있다. 예를 들어, PIM 관리장치(100)는 캐시에 저장된 태그 어레이를 통해 PEI가 접근하는 데이터의 지역성을 파악하거나, PIM 관리장치(100)에 캐시의 태그 어레이와 동일 또는 유사한 정보를 자체 저장하여 지역성을 관리할 수 있다. PIM 관리장치(100)의 다양한 실시 예는 도 2 내지 도 5에 도시되어 있다.
본 실시 예에서, PEI의 수행 주체의 결정은 애플리케이션 등의 소프트웨어에 의해 결정되는 것이 아니라, PEI가 접근하는 데이터의 지역성에 따라 PIM 관리장치(100)가 결정하므로, 프로그래머 등은 PEI의 수행 주체에 대해 별도의 고민없이 기존 프로그래밍 모델에 따라 애플리케이션을 개발하면 된다.
지역성을 기초로 PEI가 프로세서 또는 PIM에서 수행되므로, 캐시와 메모리에 저장된 데이터 사이의 일관성(coherence)에서 문제가 발생할 수 있다. 예를 들어, PEI가 PIM(130)에 수행될 때 최신 데이터(the latest version of data)가 캐시(120)에 존재하고 PIM(130)에는 이전 데이터가 존재할 수 있다. 반대로, PEI 또는 일반 명령어가 프로세서(150)에서 수행될 때 최신 데이터가 PIM(130)에 존재하고 캐시(120)에 이전 데이터가 존재할 수 있다. 이를 해결하기 위하여, PIM 관리장치(100)는 PEI의 수행 주체가 PIM(130)인 경우에, PIM(130)에게 PEI를 전달하기 전에, 캐시(120)에 저장된 데이터를 메모리에 반영하는 요청(writeback request)(읽기 동작의 PEI인 경우) 또는 캐시(120)에 저장된 데이터의 무효화 요청(invalidation request)(쓰기 동작의 PEI인 경우)을 캐시(120)에 전송한다. 다시 말해, PEI가 PIM(130)에서 수행되기 전에, 캐시(120)에 저장된 최신 데이터가 PIM에 반영되거나, 캐시에 저장된 데이터의 무효화가 진행되므로, 캐시 일관성을 만족할 수 있다.
복수의 PEI가 동시에 수행되는 경우, 동일 메모리 주소에 동시에 접근하는 경우가 발생할 수 있다. 예를 들어, 제1 PEI가 제1 메모리 주소의 데이터를 읽거나 쓰는 동작을 수행할 때, 제2 PEI가 제1 메모리 주소에 접근하여 데이터를 변경하는 것을 방지하여야 한다. 명령어(PEI 또는 일반 명령어)가 다른 명령어(PEI 또는 일반 명령어)에 의해 간섭받지 않도록 하는 것을 명령어의 원자성(atomicity) 보장이라고 한다. 원자성 보장을 위하여, PIM 관리장치(100)는 PEI가 락(lock)을 획득한 후 수행될 수 있도록 PEI가 접근하는 메모리 주소에 대한 락(lock)을 저장하고 관리한다. PIM 관리장치(100)가 락을 관리하는 방법의 다양한 실시 예는 도 2, 도 6 및 도 7에 도시되어 있다.
예를 들어, 제1 PEI가 제1 메모리 주소에 대한 읽기 또는 쓰기 동작을 수행하고자 할 경우에, 제1 PEI는 PIM 관리장치로부터 제1 메모리 주소에 대한 락을 획득한다. 락을 획득한 이후 제1 PEI가 수행된다. 제2 PEI가 제1 메모리 주소에 대한 읽기 또는 쓰기 동작을 수행하고자 할 경우에, 제1 PEI가 락을 가지고 있으므로, 제2 PEI는 해당 락이 해제될 때까지 대기 상태가 된다. PEI 사이의 원자성뿐만 아니라 PEI와 일반 명령어 사이의 원자성도 보장되어야 하는데 이에 대해서는 도 11에서 설명한다.
PEI는 일반 명령어처럼 가상 메모리 주소(virtual memory address)를 사용할 수 있다. 따라서 PEI의 가상 메모리 지원을 위해 기존의 운영 체제(operating system)나 애플리케이션을 변경할 필요가 없다. 예를 들어, PEI의 가상 메모리 주소를 기존 프로세서에 존재하는 TLB(Translation Lookaside Buffer)를 이용하여 물리 주소(physical address)로 변경한 후, PIM 관리장치(100)에 의해 결정된 수행 주체에 따라 프로세서 또는 PIM에서 PEI가 수행된다.
도 2는 본 발명에 따른 PIM 관리장치의 일 실시 예의 구성을 도시한 도면이다.
도 2를 참조하면, PIM 관리장치(100)는 PIM 디렉토리(200) 및 지역성 추적부(210)를 포함한다.
PIM 디렉토리(200)는 PEI 사이의 원자성을 보장하기 위하여 각 PEI가 접근하는 메모리 주소에 대한 읽기-쓰기 락(reader-writer lock)을 포함한다. PIM 디렉토리(200)는 PEI가 접근 가능한 모든 메모리 주소별로 읽기-쓰기 락을 포함할 수 있다. PEI가 캐시 블록 단위로 읽기 또는 쓰기 동작을 수행하는 경우에, PIM 디렉토리(200)에 포함되는 읽기-쓰기 락의 엔트리 총 개수는 메인 메모리 크기(즉, PIM의 메모리 크기)를 캐시 블록의 크기로 나눈 값 이하일 수 있다.
다른 예로, PIM 디렉토리(200)는 읽기-쓰기 락의 저장 공간을 줄일 수 있도록 일정 개수의 읽기-쓰기 락을 저장할 수 있다. 이 경우, 서로 다른 메모리 주소가 하나의 읽기-쓰기 락을 공유할 수 있으나, PEI 사이의 원자성에는 아무런 문제가 발생하지 아니한다. 이에 대해서는 도 3에서 다시 설명한다.
지역성 추적부(210)는 PEI가 프로세서에 수행될지 PIM에서 수행될지 결정하기 위한 지역성 정보를 관리한다. 지역성이 높은 경우 캐시를 활용하는 것이 유리하므로 PEI는 프로세서에 수행되고, 지역성이 낮은 경우 캐시가 크게 도움이 되지 않으므로 PEI는 메모리에서 수행되는 것이 높은 성능을 보인다.
지역성 추적부(210)는 PEI가 접근하는 데이터의 메모리 주소에 대한 정보를 포함하는 태그 어레이로 구성된다. 지역성 추적부(210)에 포함되는 태그는 캐시(120)의 태그와 동일 또는 유사한 형태일 수 있다. 태그의 일 예는 도 6 및 도 7에 도시되어 있다.
도 3은 본 발명에 따른 PIM 관리장치의 PIM 디렉토리의 일 실시 예를 도시한 도면이고, 도 4는 PIM 디렉토리 내 읽기-쓰기 락을 찾기 위한 해시 함수의 일 예를 도시한 도면이다.
도 3을 참조하면, PIM 디렉토리는 읽기-쓰기 락의 엔트리(entry)(320)를 복수 개 포함하는 어레이(310)로 구성된다. PIM 디렉토리는 읽기-쓰기 락 엔트리(320)의 저장 공간의 크기를 줄이기 위하여 일정 개수(N개)의 읽기-쓰기 락을 포함할 수 있다. 이 경우 PEI가 액세스하는 메모리 주소와 PIM 디렉토리의 읽기-쓰기 락은 일대일 대응되지 않는다. 다시 말해 복수의 메모리 주소가 하나의 읽기-쓰기 락과 대응될 수 있다.
예를 들어, 제1 메모리 주소에 대한 해시함수(330)의 값과 제2 메모리 주소에 대한 해시함수(330)의 값이 동일하면, 제1 메모리 주소와 제2 메모리 주소는 하나의 읽기-쓰기 락을 공유한다. 따라서 제1 메모리 주소에 접근하는 제1 PEI와 제2 메모리 주소에 접근하는 제2 PEI는 서로 다른 메모리 주소에 접근함에도 불구하고, 제1 PEI가 먼저 읽기-쓰기 락을 획득하면, 제2 PEI는 제1 PEI가 획득한 락이 해제될 때까지 대기한다.
각 메모리 주소에 대한 읽기-쓰기 락을 찾는 방법은 다양할 수 있으며, 일 예로, 도 4와 같이 해시함수로 XOR를 이용하여 PIM 디렉토리 내 메모리 주소에 대한 읽기-쓰기 락을 찾을 수 있다.
도 4를 참조하면, PIM 디렉토리 내 읽기-쓰기 락의 개수가 N개 일 경우, 먼저 PEI가 접근하는 메모리 주소(400)를 log2N-bit 단위로 쪼개고, 모든 조각(410,420,430,440)을 XOR하여 log2N-bit의 주소 Y를 만든다. 그리고 PIM 디렉토리에서 Y번째 읽기-쓰기 락을 해당 PEI를 위한 락으로 사용한다.
도 5는 본 발명에 따른 PIM 디렉토리의 읽기-쓰기 락에 포함되는 정보의 일 예를 도시한 도면이다.
도 5를 참조하면, 각 읽기-쓰기 락 엔트리(320)는 쓰기 락 필드(500), 읽기 락 필드(510), 읽기-카운터 필드(520) 및 쓰기-카운터 필드(530)를 포함한다.
쓰기 락 필드(500)는 PEI에게 쓰기 동작을 위한 락이 설정되었는지를 나타낸다. 예를 들어, 쓰기 락 필드(500)는 1비트로 구성되며 '1'이면 락 설정, '0'이면 락 해제를 나타낼 수 있다.
읽기 락 필드(510)는 PEI에게 읽기 동작을 위한 락이 설정되었는지를 나타낸다. 예를 들어, 읽기 락 필드(510)는 1비트로 구성되어 '1'이면 락 설정, '0'이면 락 해제를 나타낼 수 있다.
읽기-카운터 필드(520)는 읽기 락이 설정된 개수를 나타낸다. 동일한 메모리 주소에 대해 복수의 PEI가 읽기 동작만 수행하는 경우 데이터에 아무런 변경이 없으므로, 복수의 PEI가 동시 수행되어도 괜찮다. 예를 들어, 제1 PEI가 제1 메모리 주소에 대해 읽기 동작을 위한 락을 획득하면, 제1 메모리 주소에 대한 읽기-쓰기 락의 읽기-카운터 필(520)드는 1이 된다. 제1 PEI의 완료 전에 제2 PEI가 제1 메모리 주소에 대해 다시 읽기 동작을 위한 락을 획득하면, 읽기-카운터 필드(520)는 2가 된다. 락을 획득한 제1 및 제2 PEI는 동시에 수행이 가능하다. 읽기 락의 최대 허용 개수가 될 때까지 읽기-카운터 필드(520)의 값은 증가한다. 읽기 락의 최대 허용 개수를 초과하면 PEI는 락이 해제될 때까지 대기하여야 한다.
쓰기-카운터 필드(530)는 쓰기 락이 설정된 개수를 나타낸다. 읽기 락과는 달리 쓰기 락은 복수의 PEI가 쓰기 동작을 수행하는 경우 또는 복수의 PEI가 읽기 및 쓰기 동작을 수행하는 경우를 허용하지 않는다.
도 6은 본 발명에 따른 PIM 관리장치의 지역성 추적부의 일 실시 예의 구성을 도시한 도면이다.
도 6을 참조하면, 지역성 추적부(210)는 태그 어레이(600)로 구성된다. 각 태그(610)는 PEI가 접근하는 메모리 주소에 대한 데이터가 캐시에 존재하는지 여부를 나타낸다. 예를 들어, 지역성 추적부(210)의 태그 어레이(600)는 캐시(120)의 태그 어레이와 동일 또는 유사한 형태일 수 있다. 지역성 추적부(210)의 태그 어레이에 포함되는 정보의 일 예는 도 7에 도시되어 있다.
지역성 추적부(210)는 메모리 주소에 대한 해시값으로 각 태그(610)를 구분하여 저장한다. 따라서 PEI가 접근하는 메모리 주소에 대한 지역성을 파악할 때, 지역성 추적부(210)는 메모리 주소에 대한 해시값에 해당하는 태그가 존재하는지 여부를 기초로 지역성이 높은지 여부를 파악한다. 메모리 주소에 대한 해시값을 구하기 위한 해시함수(620)는 다양하며, 일 예로, 도 4와 같이 메모리 주소를 복수의 그룹으로 분할하고, 각 그룹에 대해 XOR한 값을 해시값으로 구할 수 있다.
지역성 추적부(210)의 태그 어레이(600)는 PEI가 캐시에 접근할 때마다 갱신될 뿐만 아니라 PEI가 PIM(130)에서 수행될 때에도 해당 캐시 블록에 대한 접근이 있었던 것처럼 갱신된다. 여기서 갱신이라고 함은, 캐시(120)의 태그 어레이에서 캐시 블록을 교체 또는 갱신하는 것과 동일하게 지역성 추적부(210) 내에서 각 태그(610)를 캐시의 캐시 블록 교체 알고리즘에 맞추어 교체 또는 갱신하는 작업을 말한다. PEI가 PIM(130)에서 수행될 경우, PEI가 접근하는 데이터가 캐시에 저장되지 않으므로 해당 데이터가 PEI에 의해 여러 번 접근되더라도 그 데이터의 지역성을 알 수 없기 때문이다. PEI가 메모리에서 수행될 때마다 지역성 추적부(210)를 갱신하면 여러 PEI가 동일한 메모리에 주소에 접근할 때 지역성 추적부(210)에 그 기록이 남으므로 해당 데이터가 높은 지역성을 가진다는 것을 알 수 있다.
도 7은 본 발명에 따른 지역성 추적부의 각 태그에 저장되는 정보의 일 예를 도시한 도면이다.
도 7을 참조하면, 지역성 추적부(210)에 저장되는 각 태그(610)는 유효비트 필드(700), 캐시 태그 필드(710), 갱신정보 필드(720) 등을 포함한다.
유효비트(700)는 캐시에 저장된 데이터의 유효 여부를 나타낸다.
캐시 태그 필드(710)는 캐시의 태그에 저장된 정보 또는 그 일부의 정보를 포함한다. 예를 들어, 캐시 태그 필드(710)는 캐시(120)의 태그에 저장된 메모리 주소를 도 4와 같이 해시한 값을 포함할 수 있다.
갱신정보(replacement information) 필드(720)는 캐시에 저장된 데이터의 교체를 위한 정보를 포함한다. 예를 들어, 캐시에 새로운 데이터를 저장하고자 할 경우 가장 오래전에 참조된 데이터를 삭제하는 데, 이때 갱신정보 필드(720)를 이용하여 가장 오래전 참조된 데이터를 식별한다.
도 8은 본 발명에 따른 PIM 명령어 처리를 위한 다른 실시 예의 구성을 도시한 도면이다.
도 8을 참조하면, 코어(110)는 제1 코어(112)와 PCU(PEI Computation Unit)(114)로 구성되고, 캐시(120)는 L1캐시(122), L2캐시(124) 및 LL캐시(126) 등과 같이 복수 개로 구성된다. 이 외, PIM과 데이터의 송수신을 위한 메모리 컨트롤러(800)를 포함한다. 또한 PIM(130)은 크로스바 네트워크(810), 복수 개의 DRAM 컨트롤러(820,830,840), 복수 개의 PCU(822,832,842)로 구성된다. PIM은 이 외에도 다양한 형태로 구현 가능하다.
PEI가 접근하는 메모리 주소의 데이터 크기가 캐시 블록의 크기보다 클 수 있다. 이 경우, PIM(130)는 PEI를 수행하기 위하여 데이터 사이의 맵핑 관계를 관리하기 위한 구성이 더 필요하다. 따라서 PIM이 캐시 블록 크기 이상의 데이터를 지원하는 경우에 PEI가 접근하는 메모리 주소의 데이터 크기는 제한이 없을 수 있다. 다만 이하의 실시 예에서 설명의 편의를 위하여 PEI가 접근하는 데이터의 크기는 하나의 캐시 블록이라고 가정한다. 다시 말해, PEI는 하나의 캐시 블록에 대한 쓰기 동작 또는 읽기 동작 또는 쓰기와 읽기의 동시 동작 등을 수행한다고 가정한다.
LL(Last Level) 캐시(126)는 L1 캐시(122) 및 L2 캐시(124)에 저장된 데이터와 태그 정보를 모두 포함하고 있다고 가정한다. 따라서 PIM 관리장치(100)는 본 실시 예에서 LL캐시(126)와 연결된다. 만약 LL 캐시(126)가 L1 캐시(122) 또는 L2 캐시(124)에 대한 정보를 포함하고 있지 아니하다면, PIM 관리장치(100)는 L1 캐시(122), L2 캐시(124), LL 캐시(126) 등과 각각 연결되어 본 실시 예에 따른 동작을 수행할 수 있다.
PEI가 PIM(130)에서 수행되면서 데이터를 변경할 때 캐시에 이전 버전의 데이터가 그대로 존재하는 경우에 코어(110)가 캐시(120)를 통해 최신 버전의 데이터를 읽지 못하는 문제가 있다. 따라서 쓰기 동작을 포함하는 PEI가 PIM(130)으로 보내지기 전에 PIM 관리장치(100)는 대상 캐시 블록에 대한 무효화(invalidation) 요청을 LL 캐시(126)로 보낸다. 이 요청을 받으면 프로세서의 모든 캐시(122,124,126)에서 해당 캐시 블록을 무효화시킨다. 이에 대한 구현 방법은 다양할 수 있으며, 캐시(120)가 포함 캐시 계층(inclusive cache hierarchy)이라면, 종래에 이미 존재하는 back-invalidation 요청을 그대로 사용할 수 있다. 따라서 PIM에서 변경된 데이터가 캐시에 남아 있는 데이터에 의해 가려지는 현상을 방지해 캐시 일관성을 유지할 수 있다.
PEI가 PIM(130)에서 수행되면서 데이터를 변경하지 않고, 캐시(120)에 데이터가 바뀜(dirty) 상태로 남아있는 경우 캐시(120)에 저장된 최신 데이터를 PIM(130)의 PCU(822,832,842)가 읽을 수 없으므로 해당 PEI가 이전 데이터를 기초로 수행되는 문제가 있다. 이를 해결하기 위하여 PIM의 데이터를 변경하지 않는 PEI가 PIM으로 보내지기 전에 PIM 관리장치(100)는 캐시(120)의 데이터를 메모리에 반영하도록 하는 요청을 LL 캐시(126)로 보낸다. LL 캐시(126)가 이 요청을 받으면 해당 데이터가 바뀜 상태로 남아있는 경우 이를 바뀌지 않음(clean) 상태로 바꾸고 해당 최신 데이터를 메모리(130)에 쓴다. 이후에 PEI가 수행되면 최신 데이터가 PIM(130)에 반영된 후이므로, 캐시 일관성이 유지된다.
가상 메모리를 지원하기 위하여, 각 PEI가 시작되기 전에 주어진 가상 메모리 주소를 물리 주소로 변환한다. 주소 변환을 위하여 TLB를 이용할 수 있다. 메모리 주소를 물리 주소로 변환할 경우 이후 과정에서 PEI가 수행되는 위치에 상관없이 항상 물리 주소를 사용하게 되므로 PEI에 대해 가상 메모리를 완전히 지원하게 된다. 또한, 모든 PEI가 물리 메모리 주소를 사용하기 때문에 메모리 안에 MMU(Memory Management Unit)를 넣지 않고도 PIM(130)을 위한 가상 메모리를 지원할 수 있다.
본 실시 예는, 도 1과 달리 프로세서(150) 및 PMI(130)에 각각 PCU(114,822,832,842)를 포함한다. 본 실시 예에서 각 DRAM별로 PCU(822,832,842)가 존재하므로, PEI는 하나의 캐시 블록 단위로 데이터를 읽고 쓰는 것이 바람직하다. PCU(114,822,832,842)는 지원하는 연산의 종류에 따라 그 구조가 달라질 수 있다. 프로세서 측 PCU(114)는 캐시(120)로부터 데이터를 읽고 연산하고, 필요한 경우 캐시에 데이터를 쓰는 것을 수행할 수 있는 장치이면 어떤 형태로든 구현 가능하다. 프로세서 측 PCU(114)는 본 실시 예의 이해를 돕기 위해 도시한 것으로서, 프로세서 측 PCU(114)는 코어의 일부분으로 구현되거나 소프트웨어적으로 구현되는 등 실시 예에 따라 다양한 형태로 변형 가능하다.
도 9 및 도 10은 본 발명에 따른 PIM을 이용한 명령어 처리 방법을 도 8의 구조를 기초로 도시한 도면이다.
본 실시 예의 이해를 돕기 위하여 PEI가 'x+y'의 연산을 수행하는 명령어이고, y는 코어를 통해 입력받는 피연산자(operand)이고, x는 캐시 또는 메모리에 저장된 피연산자라고 가정한다.
먼저, 도 9를 참조하면, PEI가 프로세서 측에서 수행되는 경우이다. 코어(112)가 PEI의 피연산자(operand) y를 PCU(114)에 전송한다(S900). 실시 예에 따라, PCU(114)는 TLB(Translation Lookaside Buffer)를 이용하여 PEI가 접근할 가상 메모리 주소를 물리 메모리 주소로 변환할 수 있다.
PIM 관리장치(100)는 PEI에게 피연산자 x에 대한 읽기-쓰기 락을 제공하고, 피연산자 x의 지역성을 확인한다(S910). PIM 관리장치(100)는 지역성을 기초로 PEI의 수행 주체가 프로세서(150)인지 PIM(130)인지 결정한다(S920). 본 실시 예는 지역성이 높아 PEI의 수행 주체가 프로세서(150)로 결정되었다고 가정한다.
PCU(114)는 L1 캐시(122)로부터 피연산자 x의 데이터를 읽어오고(S930). PEI를 수행한다(S940). 그리고 캐시(120)에 데이터의 저장이 필요하다면 캐시(120)에 데이터(예를 들어, x+y의 결과)를 저장한다(S950). PEI 수행이 완료되면, PCU(114)는 PIM 관리장치(100)에게 PEI 수행 완료를 통보한다(S960). 그러면 PIM 관리장치(100)는 PEI에게 제공된 읽기-쓰기 락을 해제한다. 그리고 PCU(114)는 PEI 결과값을 코어(112)에게 제공한다(S970).
다음으로, 도 10을 참조하면, PEI가 PIM에서 수행되는 경우이다. 코어(112)가 PEI의 피연산자 y를 PCU(114)에 전송한다(S1000). 실시 예에 따라, PCU(114)는 TLB(Translation Lookaside Buffer)를 이용하여 PEI가 접근할 가상 메모리 주소를 물리 메모리 주소로 변환할 수 있다.
PCU(114)는 PIM 관리장치(100)로부터 피연산자 x에 대한 읽기-쓰기 락을 획득하고 피연산자 x의 지역성을 확인한다(S1005). PIM 관리장치(100)는 지역성을 기초로 PEI의 수행 주체가 프로세서인지 PIM인지 결정한다(S1010). 본 실시 예는 지역성이 낮아 PEI의 수행 주체가 PIM으로 결정되었다고 가정한다.
PEI가 읽기 동작만 수행하는 경우에, PIM 관리장치(100)는 LL캐시(126)에 back-writeback 요청을 보내어(S1015), PEI가 접근할 데이터가 캐시에 바뀜(dirth) 상태로 존재하는 경우 이를 메인 메모리에 쓰기(writeback) 하도록 한다. PEI가 데이터를 읽고 쓰는 경우에, PIM 관리장치(100)는 LL캐시(126)에 back-invalidation 요청을 보내어(S1015), PEI가 접근할 데이터가 캐시(120)에 존재하는 경우 모두 버리도록 한다.
이후, PCU(114)는 피연산자 y를 PIM 관리장치(100)로 전송하고(S1020), PIM 관리장치(100)는 피연산자 y와 PEI를 PIM(130)으로 전송한다(S1025). PIM 관리장치(100)는 PIM(130)으로부터 결과값을 수신하면(S1030), 이를 PCU(114)를 통해 코어(112)로 전송하고(S1035,S1040), PEI에게 설정된 읽기-쓰기 락을 해제한다.
도 11은 본 발명에 따른 PIM 수행 가능 명령어와 일반 명령어 사이의 일관성을 유지하는 방법의 일 예를 도시한 도면이다.
도 11을 참조하면, PEI와 일반 명령어 사이의 일관성 유지를 위하여 새로운 함수를 도입한다. 본 실시 예에서 그 함수를 pfence()로 표시한다.
애플리케이션에서 프로세서가 명령어를 수행하다가 pfence()를 만나면, 프로세서는 pfence()전에 수행 중인 PEI를 파악한다(1120). 예를 들어, PIM 관리장치의 PIM 디렉토리를 통해 락을 획득한 PEI가 제1 및 제2 PEI(1100,1105)인 경우에, 프로세서는 제1 및 제2 PEI(1100,1105)의 수행이 완료될 때까지 일반 명령어의 수행을 대기한다.
제1 및 제2 PEI(1100,1105)에 대한 수행이 완료된 경우, 다시 말해 제1 및 제2 PEI(1100,1105)에 대한 락이 모두 해제된 경우에(1125), 프로세서는 일반 명령어를 수행한다. 제3 PEI(1110)는 pfence() 이후에 수행된 것이므로, 일반 명령어는 제3 PEI이 수행 완료되었는지와 무관하게 수행된다.
도 12는 본 발명에 따른 PIM을 이용한 명령어 처리 방법의 시뮬레이션을 위한 시스템 구성의 일 예를 도시한 도면이고, 도 13 및 도 14는 도 12의 시스템을 통한 시뮬레이션 결과를 도시한 도면이다.
본 시뮬레이션은 데이터 지역성에 따른 성능을 보여주기 위하여 10개의 애플리케이션에 대해 서로 다른 세 종류 크기의 데이터 입력을 사용하였으며, 그 결과는 도 13과 같다.
도 13을 참조하면, 모든 PEI를 프로세서에서 수행한 경우, 모든 PEI를 PIM에서 수행한 경우, 지역성을 기초로 PEI의 수행 주체를 달리한 경우의 결과값을 IPC(instructions per cycle)로 정규화한 결과가 도시되어 있다.
본 발명에 따른 방법은 입력 데이터가 클 경우(도 13(c)) 모든 PEI를 메모리에서 수행하는 것과 동일한 성능을 나타내고(프로세서에서 모두 수행하는 경우 대비 평균 47% 성능 향상), 입력 데이터가 작은 경우(도 13(a)) 모든 PEI를 프로세서 수행하는 것과 동일한 성능을 나타낸다. 입력 데이터가 작은 경우에 본 발명은 PMI에서 수행하는 경우와 대비하여 평균 32% 성능 향상을 보인다. 또한, 입력 크기가 중간 정도인 경우(도 13(b)) 프로세서에서의 수행과 PIM에서의 수행을 모두 사용하기 때문에 둘 중 한 쪽만 사용하는 것보다 향상된 성능을 보인다.
도 14를 참조하면, 에너지 소모 평가에서도 본 발명이 우수한 성능을 나타냄을 알 수 있다. 본 발명은 입력 데이터의 크기와 상관없이 종래에 비해 에너지 소모가 적은 것을 확인할 수 있다. 또한, 도 13의 성능 평가와 마찬가지로 중간 크기의 입력 데이터에 대해서는 프로세서에서의 수행과 PIM에서의 수행보다 모두 적은 에너지 소모를 나타냄을 알 수 있다.
본 발명은 또한 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 기록매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피디스크, 광데이터 저장장치 등이 있다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.
이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.

Claims (17)

  1. 명령어가 액세스하는 메모리 주소에 대한 읽기-쓰기 락(lock)을 포함하는 PIM 디렉토리; 및
    명령어가 액세스하는 메모리 주소에 대한 지역성을 파악하고, 상기 지역성을 기초로 명령어의 수행 주체가 프로세싱-인-메모리(PIM)인지 결정하는 지역성 추적부;를 포함하는 PIM 관리 장치.
  2. 제 1항에 있어서,
    상기 PIM 디렉토리에 존재하는 읽기-쓰기 락의 총 개수는 상기 PIM의 전체 저장 공간의 크기를 캐시 단위 블록의 크기로 나눈 값 이하인 것을 특징으로 하는 PIM 관리 장치.
  3. 제 1항에 있어서, 상기 PIM 디렉토리는,
    메모리 주소에 대한 해시값으로 구분하여 저장되는 읽기-쓰기 락을 포함하는 것을 특징으로 하는 PIM 관리 장치.
  4. 제 1항에 있어서, 상기 PIM 디렉토리의 각 읽기-쓰기 락은,
    쓰기 락 설정 여부를 나타내는 정보;
    읽기 락 설정 여부를 나타내는 정보; 및
    읽기 락의 개수 정보;를 포함하는 것을 특징으로 하는 PIM 관리 장치.
  5. 제 1항에 있어서, 상기 지역성 추적부는,
    캐시에 저장된 데이터의 메모리 주소에 대한 정보를 포함하는 태그를 기초로, 명령어가 접근하는 메모리 주소가 상기 태그에 존재하지 아니하면 명령어의 수행 주체를 PIM으로 결정하는 것을 특징으로 하는 PIM 관리 장치.
  6. 제 5항에 있어서, 상기 지역성 추적부는,
    캐시에 액세스하는 경우 또는 명령어의 수행 주체가 PIM으로 결정되는 경우에 태그를 갱신하는 것을 특징으로 하는 PIM 관리 장치.
  7. 제 5항에 있어서,
    상기 태그는 캐시 태그의 해시값으로 구성되는 것을 특징으로 하는 PIM 관리 장치.
  8. 제 1항에 있어서, 상기 지역성 추적부는,
    명령어의 수행주체가 PIM이면, 명령어의 동작이 쓰기 동작인지 읽기 동작인지에 따라, 캐시에 저장된 데이터를 PIM에게 반영하는 요청 또는 캐시에 저장된 데이터를 버리는 요청을 상기 캐시에게 전송하는 것을 특징으로 하는 PIM 관리 장치.
  9. 메모리 주소에 대한 읽기-쓰기 락 및 캐시에 데이터가 저장되어 있는지 여부를 나타내는 지역성 정보를 이용한 PIM 명령어 처리 방법에 있어서,
    명령어가 액세스하는 메모리 주소에 대한 읽기-쓰기 락을 획득하는 단계;
    상기 명령어가 액세스하는 메모리 주소의 지역성을 파악하는 단계; 및
    상기 지역성을 기초로 명령어의 수행 주체가 프로세싱-인-메모리(PIM)인지 결정하는 단계;를 포함하는 것을 특징으로 하는 PIM 명령어 처리 방법.
  10. 제 9항에 있어서, 상기 읽기-쓰기 락을 획득하는 단계는,
    읽기-쓰기 락 어레이로 구성된 PIM 디렉토리에서, 상기 명령어가 액세스하는 메모리 주소에 읽기-쓰기 락이 설정되어 있는지 파악하는 단계;
    락이 설정되어 있다면 락이 해제될 때까지 대기하는 단계;
    락이 설정되어 있지 않다면, 상기 명령어를 위한 락을 설정하는 단계;를 포함하는 것을 특징으로 하는 PIM 명령어 처리 방법.
  11. 제 10항에 있어서, 상기 명령어를 위한 락을 설정하는 단계는,
    상기 명령어가 읽기 동작이고, 읽기-쓰기 락의 설정 개수가 일정 개수 이하이면 명령어를 위한 락을 획득하는 단계;를 포함하는 것을 특징으로 하는 PIM 명령어 처리 방법.
  12. 제 10항에 있어서, 상기 읽기-쓰기 락이 설정되어 있는지 파악하는 단계는,
    상기 명령어가 액세스하는 메모리 주소에 대해 해시값을 구하는 단계; 및
    상기 해시값으로 상기 PIM 디렉토리를 검색하여 읽기-쓰기 락이 설정되어 있는지 확인하는 단계;를 포함하는 것을 특징으로 하는 PIM 명령어 처리 방법.
  13. 제 9항에 있어서, 상기 결정하는 단계는,
    지역성 정보를 기초로 상기 명령어가 액세스하는 메모리 주소에 대한 데이터가 캐시에 존재하면 상기 명령어의 수행 주체를 프로세서로 결정하는 단계;
    상기 메모리 주소에 대한 데이터가 캐시에 존재하지 아니하면, 상기 명령어의 수행 주체를 PIM으로 결정하는 단계;를 포함하는 것을 특징으로 하는 PIM 명령어 처리 방법.
  14. 제 13항에 있어서,
    상기 명령어의 수행 주체가 PIM으로 결정되면, 명령어가 읽기 동작에 관한 것이면 캐시에 저장된 데이터를 PIM에게 반영하는 요청을 캐시에게 전송하고, 명령어가 쓰기 동작에 관한 것이면, 캐시에 저장된 데이터를 버리는 요청을 캐시에게 전송하는 단계;를 더 포함하는 것을 특징으로 하는 PIM 명령어 처리 방법.
  15. 제 13항에 있어서,
    상기 명령어의 수행 주체가 PIM으로 결정되면, 상기 지역성 정보를 갱신하는 단계;를 더 포함하는 것을 특징으로 하는 PIM 명령어 처리 방법.
  16. 제 9항에 있어서,
    상기 명령어가 액세스하는 메모리 주소는 TLB(Translation Lookaside Buffer)를 이용하여 물리 주소로 변환된 주소인 것을 특징으로 하는 PIM 명령어 처리 방법.
  17. 제1항에 기재된 방법을 수행하기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.
PCT/KR2016/006154 2015-10-16 2016-06-10 프로세싱-인-메모리를 이용한 명령어 처리 방법 및 그 장치 WO2017065379A1 (ko)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201680071578.3A CN108369507A (zh) 2015-10-16 2016-06-10 用于使用存储器中处理来处理指令的方法和设备
US15/768,254 US10860323B2 (en) 2015-10-16 2016-06-10 Method and apparatus for processing instructions using processing-in-memory

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20150144744 2015-10-16
KR10-2015-0144744 2015-10-16

Publications (1)

Publication Number Publication Date
WO2017065379A1 true WO2017065379A1 (ko) 2017-04-20

Family

ID=58517289

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2016/006154 WO2017065379A1 (ko) 2015-10-16 2016-06-10 프로세싱-인-메모리를 이용한 명령어 처리 방법 및 그 장치

Country Status (4)

Country Link
US (1) US10860323B2 (ko)
KR (1) KR101814577B1 (ko)
CN (1) CN108369507A (ko)
WO (1) WO2017065379A1 (ko)

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10885985B2 (en) * 2016-12-30 2021-01-05 Western Digital Technologies, Inc. Processor in non-volatile storage memory
JP7242634B2 (ja) 2017-07-30 2023-03-20 ニューロブレード リミテッド メモリチップ
US10592121B2 (en) 2017-09-14 2020-03-17 Samsung Electronics Co., Ltd. Quasi-synchronous protocol for large bandwidth memory systems
US10802883B2 (en) * 2018-08-21 2020-10-13 Intel Corporation Method, system, and device for near-memory processing with cores of a plurality of sizes
KR102144185B1 (ko) * 2018-10-24 2020-08-12 전자부품연구원 상용 메모리 버스를 이용하는 프로세싱 인 메모리 장치
KR20200093823A (ko) 2019-01-29 2020-08-06 삼성전자주식회사 해시 솔루션을 위한 반도체 메모리 장치 및 이의 구동방법
CN111679785A (zh) 2019-03-11 2020-09-18 三星电子株式会社 用于处理操作的存储器装置及其操作方法、数据处理系统
US10884664B2 (en) * 2019-03-14 2021-01-05 Western Digital Technologies, Inc. Executable memory cell
US10884663B2 (en) 2019-03-14 2021-01-05 Western Digital Technologies, Inc. Executable memory cells
US10860388B1 (en) * 2019-07-09 2020-12-08 Micron Technology, Inc. Lock management for memory subsystems
KR102213258B1 (ko) 2019-07-29 2021-02-08 한국전자기술연구원 효율적인 명령어 처리를 위한 프로세싱-인-메모리 제어 방법 및 이를 적용한 연산장치
KR20210092467A (ko) * 2020-01-16 2021-07-26 삼성전자주식회사 로컬 프로세서와 글로벌 프로세서를 포함하는 메모리 다이, 메모리 장치, 및 전자 장치
WO2022006733A1 (en) * 2020-07-07 2022-01-13 NeoNexus Pte. Ltd. Apparatus and method for matrix multiplication using processing-in-memory
KR20220007404A (ko) * 2020-07-10 2022-01-18 한국전자기술연구원 프로세싱인메모리의 읽고-쓰기-연산 명령어 처리 방법 및 장치
US11435942B2 (en) * 2020-07-10 2022-09-06 Korea Electronics Technology Institute Method and apparatus for processing read-write-operation instruction in processing-in-memory
US11600332B2 (en) 2020-10-20 2023-03-07 Micron Technology, Inc. Programmable atomic operator resource locking
US20220188233A1 (en) * 2020-12-16 2022-06-16 Advanced Micro Devices, Inc. Managing cached data used by processing-in-memory instructions
US11868777B2 (en) * 2020-12-16 2024-01-09 Advanced Micro Devices, Inc. Processor-guided execution of offloaded instructions using fixed function operations
US11625249B2 (en) 2020-12-29 2023-04-11 Advanced Micro Devices, Inc. Preserving memory ordering between offloaded instructions and non-offloaded instructions
US11893278B2 (en) 2021-02-08 2024-02-06 Samsung Electronics Co., Ltd. Memory controller and memory control method for generating commands based on a memory request
US20230176863A1 (en) * 2021-12-03 2023-06-08 Taiwan Semiconductor Manufacturing Company, Ltd. Memory interface
US11921634B2 (en) 2021-12-28 2024-03-05 Advanced Micro Devices, Inc. Leveraging processing-in-memory (PIM) resources to expedite non-PIM instructions executed on a host
US20240104015A1 (en) * 2022-09-26 2024-03-28 Advanced Micro Devices, Inc. Data Compression and Decompression for Processing in Memory

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080068468A (ko) * 2007-01-19 2008-07-23 삼성전자주식회사 멀티 프로세서 시스템 온 칩에서의 메모리 관리 방법
KR20120052752A (ko) * 2010-11-16 2012-05-24 삼성전자주식회사 메모리 접근 정보를 추적하기 위한 장치 및 방법
KR20120061341A (ko) * 2010-12-03 2012-06-13 에스케이플래닛 주식회사 저장 매체에 대한 접근 관리 방법, 이를 실행하는 단말 장치 및 서비스 시스템
US20140244948A1 (en) * 2009-10-21 2014-08-28 Micron Technology, Inc. Memory having internal processors and methods of controlling memory access
KR101558807B1 (ko) * 2014-09-10 2015-10-08 한양대학교 산학협력단 호스트 프로세서와 협업 프로세서 간에 협업 처리를 위한 프로세서 스케줄링 방법 및 그 방법을 수행하는 호스트 프로세서

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1979447B (zh) * 2005-12-01 2010-05-05 孙贤和 内存数据服务器
JP2009528612A (ja) * 2006-02-27 2009-08-06 エヌエックスピー ビー ヴィ データ処理システム並びにデータ及び/又は命令のプリフェッチ方法
US8583898B2 (en) * 2009-06-12 2013-11-12 Cray Inc. System and method for managing processor-in-memory (PIM) operations
CN104252416B (zh) * 2013-06-28 2017-09-05 华为技术有限公司 一种加速器以及数据处理方法
CN104850508B (zh) * 2015-04-09 2018-02-09 深圳大学 基于数据局部性的访存方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080068468A (ko) * 2007-01-19 2008-07-23 삼성전자주식회사 멀티 프로세서 시스템 온 칩에서의 메모리 관리 방법
US20140244948A1 (en) * 2009-10-21 2014-08-28 Micron Technology, Inc. Memory having internal processors and methods of controlling memory access
KR20120052752A (ko) * 2010-11-16 2012-05-24 삼성전자주식회사 메모리 접근 정보를 추적하기 위한 장치 및 방법
KR20120061341A (ko) * 2010-12-03 2012-06-13 에스케이플래닛 주식회사 저장 매체에 대한 접근 관리 방법, 이를 실행하는 단말 장치 및 서비스 시스템
KR101558807B1 (ko) * 2014-09-10 2015-10-08 한양대학교 산학협력단 호스트 프로세서와 협업 프로세서 간에 협업 처리를 위한 프로세서 스케줄링 방법 및 그 방법을 수행하는 호스트 프로세서

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
AHN, JUNWHAN ET AL.: "PIM-Enabled Instructions: A Low-Overhead, Locality-Aware Processing- in-Memory Architecture", SOURCE: 2015 ACM/TEEE 42ND ANNUAL INTERNATIONAL SYMPOSIUM ON COMPUTER ARCHITECTURE(ISCA, 13 June 2015 (2015-06-13), pages 336 - 348, XP055374834, Retrieved from the Internet <URL:http//ieeexplore.ieee.orghcpl/articleDetails.jsp?arnumber=7284077> *

Also Published As

Publication number Publication date
US20180336035A1 (en) 2018-11-22
KR20170045098A (ko) 2017-04-26
CN108369507A (zh) 2018-08-03
KR101814577B1 (ko) 2018-01-03
US10860323B2 (en) 2020-12-08

Similar Documents

Publication Publication Date Title
WO2017065379A1 (ko) 프로세싱-인-메모리를 이용한 명령어 처리 방법 및 그 장치
US9665486B2 (en) Hierarchical cache structure and handling thereof
US7533197B2 (en) System and method for remote direct memory access without page locking by the operating system
US8285969B2 (en) Reducing broadcasts in multiprocessors
JP2819982B2 (ja) 範囲指定可能なキャッシュ一致保証機能を有するマルチプロセッサシステム
US8924624B2 (en) Information processing device
JP4065586B2 (ja) リンクリスト形成方法
US7363435B1 (en) System and method for coherence prediction
US6502168B1 (en) Cache having virtual cache controller queues
JPH04227552A (ja) ストアスルーキャッシュ管理システム
WO2017190266A1 (zh) 管理转址旁路缓存的方法和多核处理器
US6711651B1 (en) Method and apparatus for history-based movement of shared-data in coherent cache memories of a multiprocessor system using push prefetching
CN112256604B (zh) 直接存储器访问系统和方法
EP0669579B1 (en) Coherence index generation for use by an input/output adapter
US20140006716A1 (en) Data control using last accessor information
JPH0551937B2 (ko)
JPH07152647A (ja) 共有メモリマルチプロセッサ
JPH0619739B2 (ja) 多重プロセツサ・システムのキヤツシユを制御する方法
KR102492316B1 (ko) 모바일 플랫폼에 적용되는 전력 효율적 스누프 필터 설계 방법
JPS6079446A (ja) 多重仮想記憶デ−タ処理装置
US9558119B2 (en) Main memory operations in a symmetric multiprocessing computer
Li et al. High performance OpenSHMEM strided communication support with infiniband umr
JP3006204B2 (ja) 情報処理装置
US20230112575A1 (en) Accelerator for concurrent insert and lookup operations in cuckoo hashing
JPH06187239A (ja) 多階層キャッシュメモリにおけるデータ一致制御方式

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: 16855597

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15768254

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16855597

Country of ref document: EP

Kind code of ref document: A1