In industrial automation, machine learning (ML) is used to analyze sensor data for predictive maintenance or process optimization. To reduce latency and protect intellectual property, it is preferred for selected inference tasks to be run on small edge clusters instead of the cloud. Ideally, such tasks should be implemented as portable, hardware-agnostic software and executed in a secure environment to handle untrusted 3rd-party software. A potential solution is to bundle the machine learning model execution in machine-neutral WebAssembly code. The novel wasi-nn API proposal enables efficient execution of ML inference tasks from within a WebAssembly sandbox using a vendor-neutral interface. In this work, we show how these technologies can be applied to provide a solution to this challenge. We analyze existing wasi-nn implementations and design a generic architecture for “isolated inference at the edge” with a prototype implemented in Rust. We find that the wasi-nn ecosystem is still immature and native libraries are often required, which impairs the desired portability. Due to the use of native libraries by wasi-nn implementations, the performance overhead of execution in WebAssembly is insignificant. Finally, we discuss alternatives, e.g., creating custom host APIs or compiling ML frameworks to WebAssembly.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

WebAssembly with wasi-nn for Edge Machine Learning Inference: Experiences and Lessons Learned

  • Joshua Bachmeier,
  • Vladimir Yussupov,
  • Jörg Henß,
  • Heiko Koziolek

摘要

In industrial automation, machine learning (ML) is used to analyze sensor data for predictive maintenance or process optimization. To reduce latency and protect intellectual property, it is preferred for selected inference tasks to be run on small edge clusters instead of the cloud. Ideally, such tasks should be implemented as portable, hardware-agnostic software and executed in a secure environment to handle untrusted 3rd-party software. A potential solution is to bundle the machine learning model execution in machine-neutral WebAssembly code. The novel wasi-nn API proposal enables efficient execution of ML inference tasks from within a WebAssembly sandbox using a vendor-neutral interface. In this work, we show how these technologies can be applied to provide a solution to this challenge. We analyze existing wasi-nn implementations and design a generic architecture for “isolated inference at the edge” with a prototype implemented in Rust. We find that the wasi-nn ecosystem is still immature and native libraries are often required, which impairs the desired portability. Due to the use of native libraries by wasi-nn implementations, the performance overhead of execution in WebAssembly is insignificant. Finally, we discuss alternatives, e.g., creating custom host APIs or compiling ML frameworks to WebAssembly.