4 ms·
Neat. It seems like it's sort of built in to LLVM right now, but not usable unless you build LLVM yourself with pretrained models as part of the build process?
by jamesfinlayson 4y ago
Neat.
It seems like it's sort of built in to LLVM right now, but not usable unless you build LLVM yourself with pretrained models as part of the build process?
- londons_explore 4y agoHow big are the models? If just a few megabytes, why not just check them into the llvm git repo?
- jamesfinlayson 4y agoI'm not sure - https://github.com/google/ml-compiler-opt#pretrained-models https://github.com/google/ml-compiler-opt#pretrained-models says the they sometimes get released on GitHub but I couldn't see anything obvious in that repo.
- londons_explore 4y agoLooks like they do have a pretrained model: https://github.com/google/ml-compiler-opt/releases/tag/inlining-Oz-v1.1 https://github.com/google/ml-compiler-opt/releases/tag/inlin... The code will by default auto-download it during the build process. It's about 800 kbytes, which seems very reasonable for something that will reduce the generated code size by gigabytes for a large codebase. Note that the open-source-ness is dubious... They say it was trained using an optimizer which isn't opensource, and that the results are significantly better ('more generalizable') than using the open source one. In my view, if the code that makes a binary blob isn't opensource, then the project isn't opensource...
- londons_explore 4y agoYes - the default model really needs to be trained with an opensource optimizer on a corpus of open source code (ie. with a license at least as permissive as llvm itself). A blob trained with proprietary google tech on a proprietary google codebase isn't opensource. Even if it were, Google C++ differs in style quite widely from typical C++, so the model probably isn't as good as a model trained on all of github.
- londons_explore 4y agoSomeone created a github issue for this: https://github.com/llvm/llvm-project/issues/56432 https://github.com/llvm/llvm-project/issues/56432