Open hungryzzz opened 1 year ago
Hi, I tried your case, and it's stable on my end. Maybe you downloaded the iwasm
binary from the release? In the release, the iwasm is compiled with multi-tier JIT running modes. In that case, the execution time variation came from Fast JIT to LLVM JIT tier-up.
@hungryzzz The released iwasm binary was built with classic interpreter since fast-jit/llvm-jit uses the similar data structure and module instance layout with classic interpreter, so iwasm --interp
runs with classic-interpreter mode but not fast-interpreter mode. To test fast interpreter, please build iwasm manually:
cd product-mini/platforms/linux
mkdir build && cd build && cmake ..
make -j 4
# iwasm was generated under current directly with fast-interp/AOT mode enabled
@wenyongh @TianlongLiang Hi, I build the wamr from source code (commit 16ecd17a5b484dcc6e6c4f44c8dc13c54d216350), and cmake options are default(fast-interp mode).
That's strange. Do you have any background processes running? Also, you can upload your iwasm and I can have a try
I've reboot twice times, and it remains the same. And the attachment is my iwasm
. Thank you!
It's still stable on my end, can't reproduce this behavior, I tried it in a loop:
Running iteration 1
real 0m17.310s
user 0m17.302s
sys 0m0.008s
Running iteration 2
real 0m17.036s
user 0m17.035s
sys 0m0.000s
Running iteration 3
real 0m17.399s
user 0m17.394s
sys 0m0.004s
Running iteration 4
real 0m18.278s
user 0m18.274s
sys 0m0.004s
Running iteration 5
real 0m17.058s
user 0m17.049s
sys 0m0.008s
Running iteration 6
real 0m18.479s
user 0m18.474s
sys 0m0.004s
Running iteration 7
real 0m17.487s
user 0m17.474s
sys 0m0.012s
Running iteration 8
real 0m17.522s
user 0m17.514s
sys 0m0.008s
Running iteration 9
real 0m17.718s
user 0m17.706s
sys 0m0.012s
Running iteration 10
real 0m18.631s
user 0m18.626s
sys 0m0.004s
Hi, @TianlongLiang I've retried it on another server and the execution time is stable. Maybe there is something wrong with the previous server, it's really strange, I don't know why does this happen. Thank you very much!
You are welcome, I am glad it works out in the end.
Description
Hi, I run the following attached case in
Wamr
with fast-interpreter mode and find the execution time is unstable. The execution time of this case should be stable because the code has no randomness: the main thing the code does is a matrix operations,C := alpha*A*B + beta*C
, and the initializations of the arrays are all fixed.I run the case in
Wamr
with fast-interpreter mode andWasm3
30 times respectivevly. The execution time ofWamr
(fast-interp) is unstable, which is ranging from22.52s
to38.56s
; while the execution time inWasm3
is almost stable around 15s-17s. The details are as follow:Hardware & OS
Emscripten
Wasm runtime version
Repreduce
Compile the above C case using Emscripten
emcc -sENVIRONMENT=shell -O2 -s WASM=1 -s TOTAL_MEMORY=512MB -I ./case -DPOLYBENCH_TIME test.c -o test.wasm
Execute the wasm file in different wasm runtimes and collect the execution time, all the compilation and execution options are default.
case.zip