Closed qiangyupei closed 3 years ago
Hi, just to make sure: the wasm
file worked but the so
file failed? What did you use to compile the wasm
file to so
? Was it wasmedgec
or wasmedgec-tensorflow
?
Yes, I use the rustwasmc
compiler and the rustwasmc build --enable-aot
command to generate the .so file and .wasm file at the same time. The .wasm file worked, while the .so file encountered the error When executing function name: "__wbindgen_malloc" panic: toWasmEdgeValueSlideBindgen(): malloc failed.
My version: yomo-wasmedge-tensorflow 0.2.0, rustwasmc 0.1.29, yomo CLI 0.1.3.
Did you mean using the wasmedgec
or wasmedgec-tensorflow
tool to compile the generated .wasm file to .so, instead of using the .so file generated by rustwasmc build --enable-aot
directly?
My version: yomo-wasmedge-tensorflow 0.2.0, rustwasmc 0.1.29, yomo CLI 0.1.3. Did you mean using the
wasmedgec
orwasmedgec-tensorflow
tool to compile the generated .wasm file to .so, instead of using the .so file generated byrustwasmc build --enable-aot
directly?
Hi @peiqiangyu , Could you please use wasmedgec (version 0.8.2) to compile the .wasm file to .so?
wasmedgec rust_mobilenet_food_lib_bg.wasm rust_mobilenet_food_lib_bg.so
My version: yomo-wasmedge-tensorflow 0.2.0, rustwasmc 0.1.29, yomo CLI 0.1.3. Did you mean using the
wasmedgec
orwasmedgec-tensorflow
tool to compile the generated .wasm file to .so, instead of using the .so file generated byrustwasmc build --enable-aot
directly?Hi @peiqiangyu , Could you please use wasmedgec (version 0.8.2) to compile the .wasm file to .so?
wasmedgec rust_mobilenet_food_lib_bg.wasm rust_mobilenet_food_lib_bg.so
Thanks a lot, and it works now. The execution time drops from 800 ms to almost 100 ms as compared to using .wasm file.
@peiqiangyu This performance difference between .wasm and .so lies in interpreter vs AOT compilation, the latter has compiled wasm into a more efficient native binary(.so), so it can properly maximize the performance of the hardware.
@peiqiangyu This performance difference between .wasm and .so lies in interpreter vs AOT compilation, the latter has compiled wasm into a more efficient native binary(.so), so it can properly maximize the performance of the hardware.
Thank you for your answer. It also confuses me that the .so generated by rustwasmc build --enable-aot
doesn't work, and both flags '--enable-aot' and '--enable-ext' seems useless during building.
Hello, interesting project. I encounter some problems when using it. First, I uses the
rustwasmc build --enable-aot
command to generate the .so file by myself. However, there arises the errorWhen executing function name: "__wbindgen_malloc" panic: toWasmEdgeValueSlideBindgen(): malloc failed
. How can I solve the problem? And how to correctly generate the wasm .so file for use? Another question is that when I use the .wasm file instead of the .so file in the functionLoadWasmFile
, the DNN inference time (denoted byFinished post-processing in
) increases from about 200 ms to 800 ms, which seems so strange. I cannot figure it out. Thank you for the answers in advance.