commit | f237b5e06c5f3c16f2def2a6d4861d825134e04f | [log] [tgz] |
---|---|---|
author | Scott Todd <scotttodd@google.com> | Fri Jan 28 11:02:25 2022 -0800 |
committer | GitHub <noreply@github.com> | Fri Jan 28 11:02:25 2022 -0800 |
tree | acdcdf637ee44926d196deb9e1101852e7f483d8 | |
parent | 41880a44b5376387ad83054582fc62e0c2e5457d [diff] |
Add an experimental static library web demo using Emscripten. (#8171) This is a proof of concept for deploying to the web using IREE. See the README for more details. Rough structure: * `build_static_emscripten_demo.sh` compiles an MNIST sample model targeting WebAssembly (`--iree-hal-target-backends=llvm --iree-llvm-target-triple=wasm32-unknown-unknown -iree-llvm-link-static`), compiles the runtime using Emscripten, then starts a local webserver for the provided index.html * Parts of this could be folded into the CMakeLists.txt, but I think this split is easier to follow * `index.html` has the web demo code (`<canvas>` for drawing, javascript for interfacing between the UI and the Wasm module) * `main.c` has the native demo code (using IREE's high level `runtime/` API) * `device_sync.c` and `device_multithreaded.c` implement CPU devices using the static library output Future work _not_ finished here: * Finish multithreading setup. I'm still debugging something in our use of threading/synchronization primitives and Emscripten's pthreads implementation (an infinite timeout instead always returns immediately, breaking our implementation) * Support for non-static deployment by implementing an emscripten loader (similar to dlopen) * Building/testing on our CI. We have an Emscripten build in https://github.com/google/iree/blob/main/build_tools/buildkite/cmake/build_configurations.yml that could be extended to cover this though The resulting web page looks like this:  (again - proof of concept, the demo program is not very accurate and the preprocessing logic may be wrong :D)
IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler and runtime that lowers Machine Learning (ML) models to a unified IR that scales up to meet the needs of the datacenter and down to satisfy the constraints and special considerations of mobile and edge deployments.
See our website for project details, user guides, and instructions on building from source.
IREE is still in its early phase. We have settled down on the overarching infrastructure and are actively improving various software components as well as project logistics. It is still quite far from ready for everyday use and is made available without any support at the moment. With that said, we welcome any kind of feedback on any communication channels!
See our website for more information.
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.