Hello LTO folks,
This is a pitch for future RFC that proposes Integrated Distributed ThinLTO concept. We have been working this project for a while and we’d love to upstream it sooner rather than later. If we get a positive response, I will send a complete RFC in a couple of days.
Motivation in brief:
- Sony have customers with LLVM-based toolchains using a variety of build and distribution systems, including but not limited to our own (called SN-DBS). We’d like to implement support for an integrated Distributed ThinLTO (DTLTO) approach to improve their build performance.
- This approach should be very easy for the customers to adopt (as simple as adding a couple of options to the linker command line) and shouldn’t require any other additional makefile or build script modifications.
- There’s an Open Source DTLTO approach already, but it requires a build system capable of handling dynamic dependencies (such as Bazel) and there are plenty of projects where such a system is not in use (LLVM itself being a case in point).
Basic idea:
- The idea behind an integrated Distributed ThinLTO approach, very roughly, would be to have the linker (LTO library, really) orchestrate the distribution.
- There would be an interface of some kind to allow a variety of distribution systems to be implemented by either LLVM contributors or end users.
- The main benefit from our approach for the users is ease of adoption of DTLTO. If the support for a particular distributed build system is already implemented, the user only needs to tell the linker that he wants to do DTLTO and which distribution system to use. The distributed build system pushes jobs out via the appropriate implementation (assuming a distribution system is already available on the user’s network).
- So, from user’s perspective the adoption of Distributed ThinLTO will only require adding a couple of linker switches to existing build scripts.
Current status of the project:
- We already implemented support for two distributed build systems:
- Sony’s proprietary build system (SN-DBS). We have a production level implementation.
- Icecream . Currently we have proof of concept. We assumed that Open Source will be not interested in supporting Sony’s proprietary build system.
We have some concrete design ideas and as I mentioned earlier, working prototypes with the support for two build systems (SN-DBS and Icecream). If this doesn’t sound too crazy, we’d like to send a compete RFC this week and start sending patches in order to get our work in LLVM!
Note: We made a presentation in LLVM-2021 Dev meeting about Integrated Distributed ThinLTO with Icecream. 2021 LLVM Dev Mtg “Integrated Distributed ThinLTO with Icecream” - YouTube
This presentation can provide additional details about our approach.
Regards, Katya Romanova.