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

Experiment compiling ORT to WASM #5011

Open
tsteenbe opened this issue Feb 1, 2022 · 6 comments
Open

Experiment compiling ORT to WASM #5011

tsteenbe opened this issue Feb 1, 2022 · 6 comments
Labels
enhancement Issues that are considered to be enhancements new feature Issues that are considered to be new features

Comments

@tsteenbe
Copy link
Member

tsteenbe commented Feb 1, 2022

Compile ORT to WASM using one of the Java to WASM compilers.

Possible benefits:

@tsteenbe tsteenbe added enhancement Issues that are considered to be enhancements new feature Issues that are considered to be new features labels Feb 1, 2022
@tsteenbe
Copy link
Member Author

tsteenbe commented Feb 1, 2022

To add to the craziness one can use https://github.com/WebAssembly/wabt/tree/main/wasm2c to compile WASM file to C and then compile the C file to native binaries (exe, dmg, so) ;-)

@sschuberth
Copy link
Member

If the goal is to create a native binary, I wonder whether instead of going through

Kotlin Source -> Java Bytecode -> WASM -> C -> native binary

the better / less fragile approach is to go

Kotlin Source -> Graal -> native binary

see #4982. It seems the only blocker is oracle/graal#4265.

@tsteenbe
Copy link
Member Author

Compiling to native not my plan - like we now compile to JARs for JVM we would compile WASM files for WebAssembly VM which could run on a server or in a web browser. Some folks don't like to run JVM so with WebAssembly we would offer them an alternative which is likely more lightweight and possibly faster.

@tsteenbe
Copy link
Member Author

@sschuberth oracle/graal/issues/4265 was closed does it mean we could now release native ORT binaries?

@sschuberth
Copy link
Member

sschuberth commented Apr 26, 2022

We can build ORT native image since quite a while already (I had applied a work-around for oracle/graal#4265), but running it currently crashes (IIRC due to some unconfigured reflection use). But I believe that's something that could be addressed.

@sschuberth
Copy link
Member

FYI, starting with Kotlin 1.8.20 beta, there's a new backend to compile Kotlin directly to WASM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues that are considered to be enhancements new feature Issues that are considered to be new features
Projects
None yet
Development

No branches or pull requests

2 participants