[llvm-dev] [RFC] Improving Speculative Compilation in Concurrent ORC JIT

preejackie via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 13 15:40:43 PDT 2019


Dear All,

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.

Goals:

1) Create & Improve APIs to support heuristic guided speculative 
compilation in concurrent orc jit.

2) Finding key heuristics to decide what to compile next.

3) Bench marking jit with eagerly speculating full module vs heuristic 
based approach for different jit threads.

Possible caveats:

1) 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!

References:

LLVM Next Gen JIT API <https://www.youtube.com/watch?v=hILdR8XRvdQ>

Updating Orc for concurrency <https://www.youtube.com/watch?v=MOQG5vkh9J8>

Thinlto summaries in JIT <https://www.youtube.com/watch?v=ZCnHxRhQmvs>

Have a great day!
PreeJackie

-- 
Have a great day!
PreeJackie

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190314/e07fcc09/attachment.html>


More information about the llvm-dev mailing list