SEJITS: Selective, Embedded, Just-in-Time Specialization

Application writers require 3-10x fewer lines of code and can develop 3-5x faster when using productivity-layer languages (PLLs) like Ruby or Python rather than efficiency-layer languages (ELLs) like C or C++, and they don’t need to internalize new programming models like GPU’s or hybrid architectures to do so.  But PLL implementations can be 1-3 orders of magnitude slower than carefully-coded ELL implementations. SEJITS combines the best of both approaches by maintaining a catalog of hand-crafted specializers, each of which can generate ELL code to perform a particular computation pattern on a particular hardware programming model; for example, FFT on a CUDA GPU, or stencil computations on MPI.  Modern scripting languages such as Python and Ruby include the necessary facilities to allow late binding of a particular specializer to execute a function in the PLL application.

While just-in-time (JIT) code generation and specialization is well established due to the popularity of Java and Microsoft .NET, our approach selectively specializes only those functions for which we have a specializer (ELL code generator), rather than having to be able to JIT-specialize the entire PLL.  As well, the introspection and metaprogramming facilities of modern scripting languages allow the specialization machinery to be embedded in the PLL directly rather than having to modify the PLL interpreter. Hence we call our approach SEJITS—selective, embedded, just-in-time specialization.

SEJITS eases the job of efficiency programmers who create new modules specialized for particular computations: they can “drop them into” the SEJITS framework, which will make runtime decisions to use it when appropriate.  By separating the concerns of ELL and PLL programmers, SEJITS allowing independent progress in both areas.  We expect that over time, as more code generators are added to the SEJITS catalog, the main role of the PLL will be runtime specialization, dispatching, and serving as the (usually non-performance-critical) “glue” that joins expensive specialized computations together.  SEJITS therefore frees both the PLL and ELL programmers to concentrate on their respective specialties.

SEJITS open-source repo and more info:

Leave a Reply