Data caching method under PIM structure

By selecting the node with the closest Manhattan distance as the source node in the PIM system and optimizing the data caching path using hash offset and yield threshold, the problems of data access latency and load balancing in the PIM system are solved, achieving load balancing and energy efficiency improvement.

CN122138222APending Publication Date: 2026-06-02ANHUI NORMAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI NORMAL UNIV
Filing Date
2026-02-06
Publication Date
2026-06-02

Smart Images

  • Figure CN122138222A_ABST
    Figure CN122138222A_ABST
Patent Text Reader

Abstract

The application discloses a data caching method under a PIM structure, and specifically comprises the following steps: (1) taking a request node as a target node, and storing a node with the closest Manhattan distance to the target node as a source node; (2) finding a camp node on the path from the source node to the target node based on the positions of the source node and the target node and the physical address of the request data packet; and (3) storing the request data packet to the camp node when the request data packet is transmitted from the source node to the camp node. A pseudo-random offset vector based on the address characteristics is generated based on the physical address of the input request data packet, so that different data blocks transmitted between the same pair of source node and target node find different 'camp addresses' on the path, thereby distributing the storage pressure to multiple nodes on the path, significantly reducing the average access delay and network energy consumption of the PIM system and achieving load balancing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of in-store computing technology, and more specifically, this invention relates to a data caching method under a PIM structure. Background Technology

[0002] Processing-in-Memory (PIM) architecture integrates high-concurrency, high-performance computing units within memory to perform data computation locally or even on-site. PIM architecture can achieve performance acceleration of one to two orders of magnitude for some applications and reduce data transfer energy consumption by about 80%.

[0003] While in-memory computing architecture improves computing performance, it also brings a series of challenges. In PIM systems composed of 3D stacked memory, there is a conflict between data access latency and load balancing. Although the existing Traveller Cache provides multiple camp locations, how to combine routing paths to select cache locations in real time and deterministically in a highly dynamic mesh network to reduce latency from multi-hop access remains an unsolved problem. Summary of the Invention

[0004] This invention provides a data caching method under a PIM structure, aiming to solve at least one of the above-mentioned problems.

[0005] This invention is implemented as follows: a data caching method under a PIM structure, characterized in that the method is specifically as follows:

[0006] (1) The requesting node is the target node, and the node that stores the request data packet and is closest to the target node in Manhattan distance is the source node;

[0007] (2) Based on the location of the source node and the target node and the physical address of the request data packet, find the camp node on the path from the source node to the target node;

[0008] (3) When the request packet is transmitted from the source node to the camp node, the request packet is stored in the camp node.

[0009] Furthermore, the geometric midpoint position in the Mesh topology where the source node and target node are located is calculated, the offset of the geometric midpoint position is generated based on the physical address of the request data packet, and the offset geometric midpoint position is mapped back to the path from the source node to the target node to form the camp node.

[0010] Furthermore, camp nodes The specific details are as follows:

[0011] ;

[0012] in, This represents the coordinates of the geometric midpoints of the source and target nodes within the Mesh topology. Represents a mapping hash function. This indicates that points that deviate from the path are mapped back to the path from the source node to the target node. , This indicates a regulatory factor.

[0013] Furthermore, at the node The path from the source node to the target node When above, the node will be Directly used as a camp node, in the node Not located on the path from the source node to the target node When going up, Towards the path The horizontal and vertical segments are projected, and the projection nodes with smaller projection distances are taken as camp nodes; among them... .

[0014] Furthermore, when the request packet arrives at the camp node, the source node coordinates S and target node coordinates D from the request packet header are extracted. The yield gain of the request packet at that camp node is calculated. If the yield gain is greater than a set yield threshold, the camp node backs up the request packet and continues along the path. Continue forwarding.

[0015] Furthermore, the specific formula for calculating the yield of requested data packet replicas at the camp node is as follows:

[0016] ;

[0017] in, This represents the Manhattan distance from the source node to the target node. Indicates from path The Manhattan distance from the camp node to the target node.

[0018] Furthermore, before backing up the request data packet to the cache queue in the cache area, it is checked whether the cache space of the current camp node is full. If the result is yes, data with low access weight is removed, and the request data packet is copied to the end of the cache queue.

[0019] Furthermore, the access weight of data blocks in the cache queue The updated formula is as follows:

[0020] ;

[0021] in, This is based on recent access frequency. This represents the Manhattan distance from the current camp node to the source node.

[0022] Furthermore, when other nodes R request the same data packet, in each hop node from node R to source node S, the local tag table of that node is checked. The local tag table stores the backup data block of that node when it is a camp node and the corresponding source node. The local tag table of the current node is checked to see if the backup data of the source node exists. If it exists, the backup request data packet stored by that node is returned to node R.

[0023] Without hash offset In this scenario, for a given source node S and target node D, the camp nodes on the path are unique. This means that all data blocks will be crammed onto the same relay node, introducing a hash offset. This changes the situation by generating a pseudo-random offset vector based on address characteristics based on the physical address of the input request data packet. This allows different data blocks transmitted between the same pair of source and target nodes to find different "camp addresses" on the path, thereby distributing the storage pressure evenly across multiple nodes along the route. This significantly reduces the average access latency and network energy consumption of the PIM system and achieves load balancing. Attached Figure Description

[0024] Figure 1 This is a flowchart of a data caching method under a PIM structure provided in an embodiment of the present invention;

[0025] Figure 2 This is a schematic diagram of the data caching process in a 4x4 Mesh topology provided in an embodiment of the present invention. Detailed Implementation

[0026] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, so as to help those skilled in the art to have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention.

[0027] Figure 1 The flowchart of the data caching method under the PIM structure provided in the embodiment of the present invention is as follows:

[0028] (1) The requesting node is the target node, and the node that stores the request data packet and is closest to the target node in Manhattan distance is the source node;

[0029] (2) Based on the location of the source node and the target node, and the physical address Addr of the request data packet, find the camp node on the path from the source node to the target node;

[0030] (3) When the request packet is transmitted from the source node to the camp node, the request packet is stored in the camp node.

[0031] In this embodiment of the invention, each router in the stacked DRAM is treated as a node. Each node is configured with a cache area and a cache decision controller (CDC). The cache area stores a local label table, which stores the backup data block when the corresponding node is a camp node and the corresponding source node. The requesting node is treated as the target node. The node storing the request data packet is found in the Mesh topology network. The Manhattan distance between the above node and the target node is calculated. The node with the smallest Manhattan distance among the request data packets is taken as the source node. The coordinates of the target node and the source node in the Mesh topology network are obtained respectively.

[0032] Create a directory label table within the PIM structure. The directory label table records the cache identifier, cache data block identifier and physical address, and consistency status identifier of each node in the stacked DRAM.

[0033] For example, a cache identifier "1" indicates that the corresponding node's cache contains a backup data block cache, while a cache identifier "0" indicates that the corresponding node's cache does not contain a backup data block cache. When a node completes the data backup of a request data packet, it updates the cache identifier and the physical address of the cache data block in the directory label table. If the update is performed on a data block in the cache of a node, after the update is completed, the consistency status identifier in the directory label table is synchronized, changing from 1 to 0. Here, a consistency status identifier "0" indicates that the data block has not been updated, and a consistency status identifier "1" indicates that the data block has been updated. First, the consistency identifier of the request data packet is searched in the directory label table to find the updated request data packet. Then, the node that stores the updated request data packet and is closest to the target node in Manhattan distance is taken as the source node.

[0034] Set source node The coordinates are Target node The coordinates are The path from the source node to the target node It consists of a horizontal segment and a vertical segment, where the coordinates of the nodes on the horizontal segment are... , lie in and Between, the node coordinates on the vertical segment are , lie in and Between, the horizontal and vertical segments at the nodes The two places meet.

[0035] In this embodiment of the invention, the camp node is formed by offsetting the geometric midpoints of the source and target nodes in the mesh topology. The geometric midpoints of the source and target nodes in the mesh topology are calculated. coordinates ,in, , Secondly, based on the physical address of the request data packet. generated offset ,in, This represents the mapping hash function and the corresponding camp node. The specific details are as follows:

[0036] ;

[0037] in, This indicates that points that deviate from the path are mapped back to the path from the source node to the target node. , This represents the adjustment factor, used to distribute copies of data packets from different addresses across nodes on the path. Even if different data blocks are transmitted between the same source and destination nodes, they will be cached on different nodes on the path after being mapped by the mapping hash function, which is beneficial for load balancing.

[0038] In a mesh topology, "center overload" can occur. Although a large number of remote accesses have different origin and destination points, their "geometric center" often points to a few central nodes of the mesh. For example, in a 4x4 mesh topology, nodes (1,1), (1,2), (2,1), and (2,2) will quickly fill up their DRAM caches if all data is cached at the center point. Furthermore, the routing blocks of these nodes will become congested due to the large number of cache hit requests.

[0039] Regulatory factors The essence is to define the scope of the "candidate camp cluster". For example, in a 4x4 mesh topology, the central area is very small, usually set as... =2 or =4, if If the value is set too high, the copy of the data packet will be assigned to a node that is too far away from the path, which will increase the access overhead. The setting principle is that the cache pressure should be less than or equal to the width of the mesh topology. The goal is to even out the cache pressure within a local area, rather than randomize it. The adjustment factor... It is a dispersion parameter based on the preset mesh topology scale. Its technical function is to disperse meshes that are originally highly clustered at the geometric midpoint. The cache load is redirected to a cache via an address hashing algorithm. The "camp candidate set" consists of several nodes. Through this "point-to-many" mapping relationship, this invention reduces the storage pressure on the Mesh central node. .

[0040] make ,node It is very likely that it will not fall on the path. If it is impossible to obtain a copy of the request data packet from the intermediate node to shorten the transmission distance of the request data packet to the target node, additional redirection logic must be used, which will significantly increase the latency. The task is to deviate from the path nodes Reproject back onto the actual route. Mapping rules: Find the path. upper distance node Manhattan's nearest node, through this closed loop of "calculation-offset-pullback," ensures that "the cache must be on the path." "Up", thus achieving an acquisition mode without additional addressing overhead. In summary, at the node The path from the source node to the target node When above, the node will be Directly used as a camp node, in the node Not located on the path from the source node to the target node When going up, Towards the path The horizontal and vertical segments are projected, and the projection nodes with small projection distances are taken as camp nodes.

[0041] When at node Not located on the path from the source node to the target node When, The nearest projection method is used to project coordinates onto the path. First, the nodes are... Projected onto the horizontal segment Above, the x-coordinate of the projection point That is, take But limited to arrive Within the range, the y-coordinate of the projection point is ,node Distance from the projection point on the transverse segment Next, the nodes Projected onto the longitudinal segment Above, the y-coordinate of the projection point That is, take But limited to arrive Within the range, the x-coordinate of the projection point is ,node Distance from the projection point on the longitudinal segment Compare distances and distance :like , indicating nodes The closer to the horizontal segment, the more likely it is to be a camp node. ;like , indicating nodes The closer to the longitudinal segment, the more likely it is to be a camp node. .

[0042] In this embodiment of the invention, the request data packet is based on a path When a request packet passes through a camp node during transmission to the target node, the camp node's Cache Decision Controller (CDC) extracts the source node coordinates S and target node coordinates D from the request packet header. It then calculates the gain of the request packet at that camp node. Only when the gain of creating a replica of the data at the camp node is good will the camp node generate a replica of the request packet and cache it. Therefore, not all packets from streaming camp nodes will be cached. The specific formula for calculating the gain of a replica of the request packet at the camp node is as follows:

[0043] ;

[0044] in, This represents the total number of hops from the source node to the target node (Manhattan distance). Indicates from path The total number of hops from the camp node to the target node. Gain represents the number of hops saved by the camp node when reading a request data packet compared to the source node; essentially, Gain measures the proportion by which the subsequent access path is shortened after the camp node caches the data. For example, Gain=0.5 means that the caching point can eliminate 50% of the network transmission overhead of the data stream.

[0045] In the PIM system, a rate of return threshold is preset. The cache decision controller will calculate the yield gain and compare it with the yield threshold. Compare the results; if Gain ≥ This indicates that creating a replica at this camp node significantly reduces the overall network bandwidth pressure. The camp node performs a caching operation, meaning that while performing routing forwarding, the camp node copies the request packet payload to the cache queue of the local memory controller. This process does not block the transmission of packets to the target node; if Gain < This indicates that creating a replica at this camp node is not cost-effective, so the camp node does not perform caching operations and directly forwards data packets.

[0046] Introducing a yield threshold The mechanism improves the following three technical problems:

[0047] (1) Prevents cache pollution, avoiding the occupation of valuable DRAM cache space by a large amount of short-distance data that only saves 1-2 hops, ensuring that the cache stores only "long-path, high-yield" data copies; (2) Reduces write power consumption, as frequent DRAM write operations generate additional power consumption. (By using the yield threshold) Filtering out low-yield writes significantly improves the energy efficiency ratio of the PIM system. (3) Dynamic load adjustment, in advanced implementation, yield threshold The yield rate threshold can be dynamically adjusted based on the current node's cache utilization. When space is critically low, the yield rate threshold can be increased. Only allow data with extremely high yields to enter; when there is ample space, lower the yield threshold. In order to maximize the use of resources.

[0048] Before copying the request packet payload to the cache queue of the local memory controller, check whether the cache space of the current camp node is full. If the result is no, copy the request packet to the end of the cache queue. If the result is yes, remove data with low access weight and copy the request packet to the end of the cache queue.

[0049] In this embodiment of the invention, the access weight of data blocks in the cache queue within the cache region of the camp node is... The updated formula is as follows:

[0050] ;

[0051] in, This is based on recent access frequency. This represents the Manhattan distance from the current camp node to the source node. The replacement strategy prioritizes replacing access weights. The smallest data blocks are used to preserve copies of those data blocks with long transmission paths and higher reuse value.

[0052] Hash offset It is the core means of achieving "balance," which breaks the geometric symmetry and prevents all cached data from congesting the central node of the Mesh topology, without hash offset. In this scenario, for a given source node S and target node D, the camp nodes on the path are unique. This means that all data blocks will be crammed onto the same relay node, introducing a hash offset. This changes the previous approach by generating a pseudo-random offset vector based on the physical address of the input request data packet. This allows different data blocks transmitted between the same pair of source and destination nodes to find different "camp addresses" along the path, thus distributing storage pressure evenly across multiple nodes along the route. When an access request occurs, the hardware circuitry extracts the address from the data header. To ensure computational speed, a bitwise XOR operation is used. The bit positions of the address are chosen here because these bits change most frequently between different data blocks. Next, the resulting hash value h is range-reduced using the adjustment factor K described earlier. The offset is then superimposed onto the geometric midpoint P. base The coordinates are obtained from the above. Because DRAM writing is very energy-intensive, hash offsets distribute the heat across different areas of the mesh, preventing localized overheating. Most importantly, because... It is address-based, so the requester doesn't need to check to know the location of the replica. By simply running the same hash logic once, the exact location of the replica on the path can be calculated.

[0053] and There is a very clever connection between them. Responsible for "pushing" the data. Responsible for "pulling back" the data. An attempt was made to "push" the data blocks that were originally crowded in the central node outwards to ensure that the replicas were "on the path". The points that were "pushed away" are reprojected back onto the path.

[0054] This invention provides a clearer understanding of its process through the complete execution within a simple 4x4 Mesh topology, as detailed below:

[0055] The source node S (0,3) stores the original request data packet, the request point D (target node) (3,0), and other requesters with the same request data packet R (2,1). Parameter settings: adjustment factor K=4 (providing four discrete directions), yield threshold. =0.3 (caching is only performed when more than 30% of the path is saved), and the routing protocol is XY routing. Initialization phase: When all nodes start up, they will allocate a 16MB cache pool in their local memory and enable the Cache Decision Controller (CDC).

[0056] From source node S to destination node D: According to the XY route, the data packet first travels along the horizontal segment, then along the vertical segment, with the path being: (0,3)→(1,3)→(2,3)→(3,3)→(3,2)→(3,1)→(3,0). Total hop count =6. When a data packet passes through a router, CDC extracts the physical address (Addr) of the request data packet, and then calculates the coordinates of the geometric midpoint in the mesh topology where the source and destination nodes reside. Assuming The corresponding offset is (+1, +1), then the node At this point, a node was discovered. Not in path Above, at this time Intervention will node Pull back path superior.

[0057] node Projection onto the horizontal segment: On the horizontal segment (0,3)−(3,3), the distance is... The nearest point is (2,3), with a lateral projection distance of 1; node Projection onto the longitudinal segment: On the longitudinal segment (3,3)−(3,0), the distance The nearest point is (3,2), with a vertical projection distance of 1. Since the distance is always 1, the system defaults to selecting segment X, ultimately determining the camp node as... .

[0058] Next, when the data packet flows to the camp node (2,3), the yield (Gain) calculation begins. The distance from the camp node (2,3) to the target node (3,0) is... yield If Gain > σ, and the condition is met, the node starts an asynchronous bypass copy to store the data in the local cache.

[0059] Next, in the subsequent access phase, node R (2,1) wants to access the same data. In a mesh topology, paths from different nodes to the same source node often partially overlap (especially when using XY routing). Therefore, at each hop (router) from node R to source node S, the local label table of that node is checked. This local label table stores the backup data blocks of that node when it was a camp node and the corresponding source node. This node happens to be the camp node selected when source node S communicates with target node D. When the request data packet arrives at the camp node, it will be intercepted here. No additional computation is required for node R, and it is completely transparent to the software. When the CDC detects a tag match, the camp node (2,3) directly transmits the corresponding backup data back to node R (2,1). Comparing the benefits: the distance required for node R to retrieve data from the source node S is [not specified]. Jumping from the camp node (2,3) requires a distance of [distance needed]. Latency was reduced by 50%, and traffic in the central network area was significantly reduced.

[0060] This invention is achieved through and Load balancing is achieved through cooperation; "zero metadata" is achieved through path overlap and self-checking the local tag table; through the filtering of yield gain, the system will not blindly cache when there is only one hop of gain, thus protecting the DRAM lifespan.

[0061] The present invention has been described by way of example. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any non-substantial improvements made using the inventive concept and technical solution of the present invention, or the direct application of the inventive concept and technical solution of the present invention to other occasions without modification, are all within the protection scope of the present invention.

Claims

1. A data caching method under a PIM structure, characterized in that, The method is as follows: (1) The requesting node is the target node, and the node that stores the request data packet and is closest to the target node in Manhattan distance is the source node; (2) Based on the location of the source node and the target node and the physical address of the request data packet, find the camp node on the path from the source node to the target node; (3) When the request packet is transmitted from the source node to the camp node, the request packet is stored in the camp node.

2. The data caching method under the PIM structure as described in claim 1, characterized in that, Calculate the geometric midpoint position in the Mesh topology where the source node and target node are located, generate the offset of the geometric midpoint position based on the physical address of the request data packet, and map the offset geometric midpoint position back to the path from the source node to the target node to form the camp node.

3. The data caching method under the PIM structure as described in claim 1, characterized in that, Camp Node The specific details are as follows: ; in, This represents the coordinates of the geometric midpoints of the source and target nodes within the Mesh topology. Represents a mapping hash function. This indicates that points that deviate from the path are mapped back to the path from the source node to the target node. , This indicates a regulatory factor.

4. The data caching method under the PIM structure as described in claim 3, characterized in that, At the node The path from the source node to the target node When above, the node will be Directly used as a camp node, in the node Not located on the path from the source node to the target node When going up, Towards the path The horizontal and vertical segments are projected, and the projection nodes with smaller projection distances are taken as camp nodes; among them... .

5. The data caching method under the PIM structure as described in claim 1, characterized in that, When a request packet arrives at a camp node, the source node coordinates S and the destination node coordinates D from the request packet header are extracted. The yield gain of the request packet at that camp node is calculated. If the yield gain is greater than a set yield threshold, the camp node backs up the request packet and continues along the path. Continue forwarding.

6. The data caching method under the PIM structure as described in claim 5, characterized in that, The specific formula for calculating the yield of requesting a data packet replica at the camp node is as follows: ; in, This represents the Manhattan distance from the source node to the target node. Indicates from path The Manhattan distance from the camp node to the target node.

7. The data caching method under the PIM structure as described in claim 5, characterized in that, Before backing up the request data packet to the cache queue in the cache area, check whether the cache space of the current camp node is full. If the result is yes, remove data with low access weight and copy the request data packet to the end of the cache queue.

8. The data caching method under the PIM structure as described in claim 7, characterized in that, Data block access weight in the cache queue The updated formula is as follows: ; in, This is based on recent access frequency. This represents the Manhattan distance from the current camp node to the source node.

9. The data caching method under the PIM structure as described in claim 1, characterized in that, When another node R requests the same data packet, in each hop node from node R to the source node S, the local tag table of that node is checked. The local tag table stores the backup data block of the node when it is a camp node and the corresponding source node. The local tag table of the current node is checked to see if the backup data of the source node exists. If it exists, the backup request data packet stored by the current node is returned to node R.