Drrip set dueling - with tests#689
Conversation
Added tests for new classes.
|
I don't know what is causing this? The includes seem correct. |
|
The problem is that you've got Good idea to pull the set sampling into the MSL, by the way. I anticipate that could be useful. |
|
Before we consider merging this, I should probably do some performance comparisons between lru, drrip, and ship to make sure these are working right. |
|
Realized how I was using the new class in DRRIP was leading to a double-inversion and correlating positively on miss instead of negatively. DRRIP updates on miss, so an update from a set with one policy should increment the counter towards the other policy. If I just flip the duel result that doesn't work, since the sample sets will get inverted as well so the entire system ends up behaving exactly the same. Instead, I added a flag to the update() method to invert the way each category increments the counter, which seems to be the most-elegant solution to this problem. Settings the inv flag to true means you train against the policy, and leaving it unspecified/false means you count towards the policy. Performance checks seem to confirm that this is correct, I am seeing a strong lru < DRRIP < SHiP relationship on the workloads I grabbed from the SHiP paper. |
|
Hot take: boolean parameters are an antipattern because they leak a function's control flow to the caller. I think it may actually be a more clear API design to have two update functions: |
ngober
left a comment
There was a problem hiding this comment.
I have one final pass of cleanup feedback, but I think this is good to go.
Author: maccoymerrell Committer: GitHub Drrip set dueling - with tests (#689) Extension of PR from @Quangmire with the following improvements: 1. set sampling duel counter type (dscounter) added, which implements the set sampling duel counter feature utilized by many replacement policies and prefetchers 2. categorizer type, which implements the sampling utilized by 1 as a categorizer, evenly splitting a given value into a sampled number of categories (where 0 and 1 are used as indicators by the dscounter of those sets to be sampled). How input values are translated to integers to be sampled relies on a user-defined projection object. 3. static inlines of get_num_samples() and get_sample_rate() which when provided a population? provides the recommended number of samples and the corresponding sample rate. 4. The addition of a new msl/stat_methods.h header which includes 1, 2, and 3 (and in the future could include other structures like this) 5. Tests for features introduced in 1, 2, and 3 --------- Co-authored-by: Quang Duong <[email protected]>
Extension of PR from @Quangmire with the following improvements: