The new concurrent orc jit support speculative compilation with a naive implementation and laziness. Compiling everything up-front can consume more CPU and memory than needed and also impose significant effect on resource constraint systems due to context switching of JIT threads (coarse level parallelism). The main idea here is to develop heuristics to find which functions are worth compiling into executable bits, speculatively using jit threads.
Heuristics can be extracted by analyzing higher level program representations such as ASTs, CFGs and from LLVM IR. Profile guided optimization can also used to determine heuristics with greater confidence level based on previous execution steps.
Create & Improve APIs to support heuristic guided speculative compilation in concurrent orc jit.
Finding key heuristics to decide what to compile next.
Bench marking jit with eagerly speculating full module vs heuristic based approach for different jit threads.
- More time spent in analyzing what to compile next than actually compiling. These can addressed once we have basic working prototype, so that we can find out the bottlenecks and remove it. Or may be parallelizing analysis process.
Currently, I’m trying to find heuristics that can be used for this project and familiarizing with concurrent jit design and APIs. Also, please note that this idea has been proposed by Lang Hames and I would like to propose this idea & implementation for GSoC 2019 and I’m improvising this idea. I would like to know the community responses!
This can serve as a good documentation for me to write a proposal and to keep things in track.
Any thoughts on finding useful heuristics are highly appreciated I have also started a thread in Numba JIT project to see what heuristics they are using.
Also anyone interested in mentoring this project please reply!