by throwaway_26758 · 9y ago · 0 comments
Many of the techniques given here (and elsewhere in the glut of DSLs) are quietly folded into mainstream C compilers within a short timeframe -- first as requiring explicit hints just like the DSLs, then secondly simplified to allow the compiler to automatically infer hints from well-structured code relying on transformation guarantees of standard C idioms.
So if you stick with strict C and come to understand the implicit assumptions/guarantees the standard dictates while conveying structure in your code, in time the compiler suites will march forward in improvements that come with each update 'for free.'
And most importantly, update your testing infrastructure to be formally verified each refactoring (such as with CBMC) so that there's no regression problems caused by compiler updates with free reign!
Halide gives the optimizer control over a broader set of design decisions. While the image-processing focus limits Halide (I wish it were designed for neural nets and embedded in Tensorflow), the lessons here are powerful and have potential that go beyond C compiler improvements.
Though (I'm not an expert on the subject) but it seems like high perf convnet kernels requires assembly for specific architectures - like Scott Gray's fast Winograd kernels optimised for NVidia.
Woukd be awesome if someone wrote fast conv kernels for AMD GPUs but it seems like a lot of effort