Hacker News new | ask | show | jobs
by spwa4 24 days ago
This is something AI is really good at. Plus, you don't need AI for this. In my time at <FANG> I made a "runtime compiler" that did this for parallelizable calculations (applying kernels on images, this was a long time ago). It didn't even need information on the machine it was running on, it just spent 5-6 seconds during startup trying some 50 different memory access patterns, figuring out the size of the cache from when it slows down, ... and then you had a simple language you could specify operations to execute on large images and it would do them. Fast. Very fast.

And yes, this was only worth doing for things that were memory bound. But anything relating to images is, pretty much.

I wrote something similar for regexes too. Get all matches from a massive file, or check massive numbers of lines of text and figure out which ones match a given regex. That too is still running. Even the AI models are now using it, although I'm told they at least also improved that one. I wonder how, actually.

A team took over the image compiler and it's still running, I'm told. I got 12k'd, of course. At this point there's literally ONE person left in the team that created the core tools, and he's the one known for going into management first chance he got.

I should write an open source version of this focusing on ML. I wonder how hard that actually is ...

1 comments

> It didn't even need information on the machine it was running on, it just spent 5-6 seconds during startup trying some 50 different memory access patterns, figuring out the size of the cache from when it slows down, ... and then you had a simple language you could specify operations to execute on large images and it would do them. Fast. Very fast.

This is pretty cool. It sounds very similar to how FFTW works. You create a plan, and you give it as much time as you're willing to spend on planning. It will then use that time to find the fastest set of underlying kernels for your hardware and input size.