Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement multi-tier compilation framework #1302

Open
wenyongh opened this issue Jul 18, 2022 · 0 comments
Open

Implement multi-tier compilation framework #1302

wenyongh opened this issue Jul 18, 2022 · 0 comments
Labels
new feature New feature request

Comments

@wenyongh
Copy link
Contributor

wenyongh commented Jul 18, 2022

Motivation

Recently another lightweight JIT engine - Fast JIT was developed with quick startup, small footprint and relatively good performance:
https://github.com/bytecodealliance/wasm-micro-runtime/issues/1292
To make it work together with LLVM JIT (Orc Lazy JIT), the multi-tier compilation framework is planned to be implemented:

  1. Tier-up from Fast JIT to LLVM JIT to gain quick startup and better performance

Compilation Strategies

There are some possible strategies:

  1. Similar to current LLVM Orc Lazy JIT's strategy
    Main thread Lazy JIT compilation + Backend threads eager compilation

  2. Similar to V8 JIT tier-up
    Backend threads with eager compilation to compile all wasm functions with Fast JIT, wait until the compilation ends, then instantiate the wasm module and execute the wasm function. At the same time, launching LLVM JIT to compile wasm functions, and switching to LLVM JIT function gradually when executing.

@wenyongh wenyongh added the new feature New feature request label Jul 18, 2022
wenyongh added a commit that referenced this issue Oct 18, 2022
Refactor LLVM JIT for some purposes:
- To simplify the source code of JIT compilation
- To simplify the JIT modes
- To align with LLVM latest changes
- To prepare for the Multi-tier JIT compilation, refer to #1302

The changes mainly include:
- Remove the MCJIT mode, replace it with ORC JIT eager mode
- Remove the LLVM legacy pass manager (only keep the LLVM new pass manager)
- Change the lazy mode's LLVM module/function binding:
  change each function in an individual LLVM module into all functions in a single LLVM module
- Upgraded ORC JIT to ORCv2 JIT to enable lazy compilation

Refer to #1468
wenyongh added a commit that referenced this issue Dec 19, 2022
Implement 2-level Multi-tier JIT engine: tier-up from Fast JIT to LLVM JIT to
get quick cold startup by Fast JIT and better performance by gradually
switching to LLVM JIT when the LLVM JIT functions are compiled by the
backend threads.

Refer to:
#1302
wenyongh added a commit that referenced this issue Dec 19, 2022
Implement 2-level Multi-tier JIT engine: tier-up from Fast JIT to LLVM JIT to
get quick cold startup by Fast JIT and better performance by gradually
switching to LLVM JIT when the LLVM JIT functions are compiled by the
backend threads.

Refer to:
#1302
wenyongh added a commit that referenced this issue Dec 19, 2022
Implement 2-level Multi-tier JIT engine: tier-up from Fast JIT to LLVM JIT to
get quick cold startup by Fast JIT and better performance by gradually
switching to LLVM JIT when the LLVM JIT functions are compiled by the
backend threads.

Refer to:
#1302
wenyongh added a commit that referenced this issue Dec 20, 2022
Implement 2-level Multi-tier JIT engine: tier-up from Fast JIT to LLVM JIT to
get quick cold startup by Fast JIT and better performance by gradually
switching to LLVM JIT when the LLVM JIT functions are compiled by the
backend threads.

Refer to:
#1302
NingW101 pushed a commit to NingW101/wasm-micro-runtime that referenced this issue Jan 11, 2023
Implement 2-level Multi-tier JIT engine: tier-up from Fast JIT to LLVM JIT to
get quick cold startup by Fast JIT and better performance by gradually
switching to LLVM JIT when the LLVM JIT functions are compiled by the
backend threads.

Refer to:
bytecodealliance#1302
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this issue May 27, 2024
Refactor LLVM JIT for some purposes:
- To simplify the source code of JIT compilation
- To simplify the JIT modes
- To align with LLVM latest changes
- To prepare for the Multi-tier JIT compilation, refer to bytecodealliance#1302

The changes mainly include:
- Remove the MCJIT mode, replace it with ORC JIT eager mode
- Remove the LLVM legacy pass manager (only keep the LLVM new pass manager)
- Change the lazy mode's LLVM module/function binding:
  change each function in an individual LLVM module into all functions in a single LLVM module
- Upgraded ORC JIT to ORCv2 JIT to enable lazy compilation

Refer to bytecodealliance#1468
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this issue May 27, 2024
Implement 2-level Multi-tier JIT engine: tier-up from Fast JIT to LLVM JIT to
get quick cold startup by Fast JIT and better performance by gradually
switching to LLVM JIT when the LLVM JIT functions are compiled by the
backend threads.

Refer to:
bytecodealliance#1302
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this issue May 27, 2024
Implement 2-level Multi-tier JIT engine: tier-up from Fast JIT to LLVM JIT to
get quick cold startup by Fast JIT and better performance by gradually
switching to LLVM JIT when the LLVM JIT functions are compiled by the
backend threads.

Refer to:
bytecodealliance#1302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature request
Projects
None yet
Development

No branches or pull requests

1 participant