US 12,093,188 B2
Prefetch-adaptive intelligent cache replacement policy for high performance
Juan Fang, Beijing (CN); Huijing Yang, Beijing (CN); Ziyi Teng, Beijing (CN); Min Cai, Beijing (CN); and Xuan Wang, Beijing (CN)
Assigned to BEIJING UNIVERSITY OF TECHNOLOGY, Beijing (CN)
Filed by BEIJING UNIVERSITY OF TECHNOLOGY, Beijing (CN)
Filed on Apr. 12, 2022, as Appl. No. 17/719,304.
Application 17/719,304 is a continuation of application No. PCT/CN2021/119290, filed on Sep. 18, 2021.
Claims priority of application No. 202110606031.1 (CN), filed on May 24, 2021.
Prior Publication US 2022/0374367 A1, Nov. 24, 2022
Int. Cl. G06F 12/12 (2016.01); G06F 9/30 (2018.01); G06F 9/38 (2018.01); G06F 9/50 (2006.01)
CPC G06F 12/12 (2013.01) [G06F 9/30043 (2013.01); G06F 9/3816 (2013.01); G06F 9/5044 (2013.01)] 3 Claims
OG exemplary drawing
 
1. A prefetch-adaptive intelligent cache replacement policy for high performance comprising:
distinguishing prefetch and demand requests, using an ISVM-based prefetch predictor to predict re-reference interval for cache lines loaded by prefetch access, using an ISVM-based demand predictor to predict re-reference interval for cache lines loaded by demand access;
wherein cache replacement is performed based on predicted results, each predictor corresponding to a set of ISVM tables, ISVM table A corresponds to a PC address B, and ISVM table A consists of PC addresses B and 16 ISVM weights, of which the 16 ISVM weights correspond to 16 PC addresses that have the most occurrences in PCHR except B, and an initial value of the weight is set to 0;
wherein training process of the two predictors is the same, including the following steps:
preparation of training data:
step 1. select part of cache sets in a last level cache as sampling sets, input data of the demand predictor includes a PC address of a load instruction that generates a demand access. and past PCs stored in PCHR;
the input data of the prefetch predictor includes PC address of the load instruction that triggers the prefetch access, and past PCs stored in the PCHR;
PCHR added on the hardware is used to save the past load instructions in the process of running PC history record;
step 2, add a component DMINgen, and reconstruct Demand-MIN algorithm on the hardware to provide training labels for the input data of a training predictor; the training labels are divided into positive example labels and negative example labels; the positive example label indicates that a currently accessed cache line is cache-friendly which can be inserted into the cache; the negative label indicates that the currently accessed cache line is cache-averse and cannot be inserted into the cache; the specific generation method is as follows:
for a usage interval that ends with the prefetch access P, namely D-P and P-P. DMINgen determines that the currently accessed cache line will not generate a demand hit, and at this time generates a negative label for a PC that accessed the cache line last time;
for the usage interval that ends with demand access D, namely P-D and D-D, DMINgen determines that the currently accessed cache line will generate a demand hit; a positive label is generated for the PC that accessed the cache line last time; if the cache space is full at a certain moment in the usage interval, a negative label is generated for the PC that accessed the cache line last time;
the described usage interval refers to a time interval that starts with a reference to X and proceeds up to its next reference X; the usage interval of line X represents a requirement of line X to the cache, and is used to determine whether the reference to line X will cause a cache hit;
predictor training:
ISVM-based prefetch predictor and the ISVM-based demand predictor are trained separately according to the memory access behavior of the sampled cache sets with the same training method, specifically: after the predictor reads the input data, the ISVM table corresponding to the predictor find the weights corresponding to the current input data of PC and in PCHR, if the label corresponding to the input data is positive, the weight will increase by 1; otherwise, the weight will decrease by 1; if a sum of weights corresponding to the current input data PC and PCHR in the ISVM table is greater than a threshold, the weight will not be updated this time.