News for hackers. Stuff that matters.
Re:Building a Language and Compiler for Machine Learning by UncleOxidant on Monday December 03, 2018 @06:34PM (#18594303)
I'm tasked with running several ML algorithms on a new hardware accelerator. Currently there is an LLVM toolchain for that new hardware, but no Python support is expected for a while which means implementing a bunch of ML code in C or maybe C++ (not a very pleasant prospect). I'm wondering, since Julia has an LLVM backend would it be possible to emit LLVM IR from Julia which could then be fed into our LLVM toolchain?

One thing that comes to mind here: does Julia use some kind of primitives for various things like matrix multiplication that might be difficult to export at the LLVM-IR level?

Re:Building a Language and Compiler for Machine Learning by KenoFischer on Monday December 03, 2018 @06:41PM (#18594351)
Yes, Julia tends to be quite good at this kind of thing. Which level you want to operate at will depend on the details of the accelerator. Happy to give some pointers if you can give me a rough idea of the target architecture and what software already exists. My email is in my HN profile.
Re:Building a Language and Compiler for Machine Learning by wallnuss on Monday December 03, 2018 @09:10PM (#18595366)
Take a look at CUDAnative.jl (https://github.com/JuliaGPU/CUDAnative.jl) which uses the NVPTX LLVM backend to compile Julia code to the GPU. What you described sounds very similar to that and could definitely made to work.
Re:Building a Language and Compiler for Machine Learning by byt143 on Monday December 03, 2018 @07:04PM (#18594497)
I believe Julia has generic kernels for many linear algebra ops (like matrix multiply) that the compiler can use to generate code for different backends and types as a fallback to BLAS.
Re:Building a Language and Compiler for Machine Learning by orbifold on Tuesday December 04, 2018 @02:33AM (#18597141)
I would not dismiss C or C++ as viable avenues of progress. There are viable C++ / C only deep learning libraries https://pjreddie.com/darknet/, available that are easily ported and embedded C++ can be pretty pleasant to write. We currently use C++14 on a embedded Power processor with custom vector unit and 16kB of SRAM and it works like a charm.