Inspiration - We are computer architecture students trying to program a feasible (resource-wise) branch prediction and targeting maximum accuracy... which is of utmost importance given the current deep pipelines in modern processors

What it does - It predicts whether a branch (decisional code snippet) will be picked up by the hardware or not. This, in turn, allows the processor to proceed with speculative execution of branches and future instructions

How we built it - For our branch prediction algorithm we use a scaled neural branch predictor, which is a scaled perceptron. For updation of the threshold of confidence in the accuracy of the prediction, we use a o-GEHL type dynamic threshold updation. We use a hash function to effective eliminate aliasing among branch path while mapping the branch addresses to the weights.

Challenges we ran into - To find the right hash function which is crucial in reducing the MPKI(Mispredictions per Kilo Instruction - the standard measure). Also various empirical values required lot of research and data training.

Accomplishments that we're proud of - Our MPKI has reached 2.3 with the industrial SPEC 2000 benchmarks. And we did this with really low hardware requirements.

What we learned - There are 3 elementary parts to branch predictions:

  1. The algorithm., 2. The dynamic training and updation of various parameters, 3. Hash function to eliminate aliasing

What's next for Advanced neural branch prediction for modern caches-

Making it a hybrid predictor which dynamically chooses between the branch with the best accuracy

Built With

  • cpp-code
  • library
  • spec-benchmarks
Share this project:

Updates