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

[LLVM][RUNTIME] Add optional LLVM ORCJIT runtime executor #15964

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

cbalint13
Copy link
Contributor

@cbalint13 cbalint13 commented Oct 21, 2023

This PR introduce a new LLVM ORC JIT executor for the runtime.
The new ORCJIT may obsolete MCJIT due to better upstream maintenance.


Changes

  • Old MCJIT is default , thus the previous behaviour is unchanged.
  • The new ORCJIT is added as a alternative and optional llvm runtime engine.

Rationale

  • MCJIT is the first implementation in LLVM and looks to be unmaintained by upstream.
  • The new ORCJIT is added and it shares the same flow configuration as the current MCJIT.
  • Targets like RISCV, and possible others too, will not work on MCJIT see some discussions here .
  • The new ORCJIT offers flexibile custom compilation and linkage flow that can be useful for future challenges.

Usage

  • The default is the old MCJIT so no changes in any behaviour of TVM, but being limited it fails on e.g. RISCV:
[23:35:43] src/target/llvm/codegen_llvm.cc:185: Warning: Set native vector bits to be 128 for riscv64
LLVM ERROR: Relocation type not implemented yet!
  • The new ORCJIT can be invoked by llvm -jit=orcjit {...}, this works even on RISCV targets.

This implementation here is backward compatibile and was tested on LLVM={10,11,12,13,14,15,16,17,18}


Halide project also leverage orcjit runtime.
Also may relate to PR #14836 and TK #10141 ongoing effort toward RISCV tensorization.

@cbalint13 cbalint13 force-pushed the llvm-orcjit branch 8 times, most recently from 623f31a to ef548b8 Compare October 22, 2023 10:36
@cbalint13 cbalint13 closed this Oct 22, 2023
@cbalint13 cbalint13 reopened this Oct 22, 2023
@cbalint13 cbalint13 force-pushed the llvm-orcjit branch 6 times, most recently from 6b42ee9 to 144bd49 Compare October 22, 2023 23:29
@cbalint13 cbalint13 marked this pull request as ready for review October 23, 2023 10:17
@cbalint13
Copy link
Contributor Author

This is ready for review.
Cc: @Lunderberg , @junrushao , @masahi , @vinx13, @tqchen , @ekalda , @lhutton1 , @quic-sanirudh , @kparzysz-quic
Cc: @katebern-grovety , @PhilippvK

@cbalint13 cbalint13 force-pushed the llvm-orcjit branch 2 times, most recently from c641f18 to e3053bb Compare December 18, 2023 11:29
@tqchen
Copy link
Member

tqchen commented Mar 7, 2024

@cbalint13 do you mind to rebase on latest main? love to get it in

@cbalint13
Copy link
Contributor Author

cbalint13 commented Mar 8, 2024

@tqchen

@cbalint13 do you mind to rebase on latest main? love to get it in

It is rebased now, glad to see it as being useful.
Thank you !

@tqchen tqchen merged commit cae1af6 into apache:main Mar 11, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants