Re:Make your programs run faster by better using the data ca...
by jakeinspace on Saturday June 24, 2023 @02:37AM
(#36456181)
I’m working on a masters thesis doing essentially this, for the problem of prefetching. There are a lot of existing papers demonstrating techniques for smarter prefetching for non- sequential data structures like trees and graphs. That can be done with some success purely at the hardware level, but having language- level semantic information helps a lot for dealing with complex data structures. What I’m working on is a cache controller modification to allow the running program or OS to tell the cache controller how best to prefetch specific pieces of data.
[ Parent
| on HN ]
Re:Make your programs run faster by better using the data ca...
by jacknews on Saturday June 24, 2023 @03:35AM
(#36456452)
"having language- level semantic information helps a lot for dealing with complex data structures."
Yes that's what I'm thinking - much of the current stuff seems to be trying to guess what the code is doing from a low level (eg branch prediction) whereas the language itself could tell.
Re:Make your programs run faster by better using the data ca...
by mhh__ on Saturday June 24, 2023 @08:32AM
(#36458148)
I'm pretty sure I've read a PhD thesis that implements exactly that - e.g. the program can load a program into the prefetcher
Sounds like a nightmare post-spectre.
Re:Make your programs run faster by better using the data ca...
by jakeinspace on Saturday June 24, 2023 @10:09AM
(#36458814)
Definitely possible, it’s a fairly active area. There are a few very similar techniques I’ve seen covered, but I think the details of my/our approach are still unique enough to merit publishing (for now), if I can get reasonable performance results.
And yes, loading semi-arbitrary code into a prefetcher is quite scary. It was the first question I had about this project. I think that maybe picking and choosing one of a multitude of prefetching "recipes" which are trusted would be more plausible as en eventual viable strategy. Like, the compiler inserts some instructions after allocating the nodes of a DAG that says "hey prefetcher, this is a DAG, please choose the graph prefetching algo with x/y/z parameters."