web-devkits / Wasmnizer-ts

Toolchain for compiling TypeScript to WasmGC
Apache License 2.0
302 stars 26 forks source link

Run benchmark error #136

Closed beautiful-boyyy closed 9 months ago

beautiful-boyyy commented 9 months ago
Run binarytrees_class benchmark by WAMR aot:
LLVM ERROR: Only small, tiny and large code models are allowed on AArch64
./run.sh: line 46: 43945 Abort trap: 6           $wamrc --enable-gc -o $prefix.aot $prefix.wasm > tmp.txt
Read file to buffer failed: open file binarytrees_class.aot failed.

sys: macos 14.2 arm64

xujuntwt95329 commented 9 months ago

Hi, I don't have a M2 MacOS now, could you please try to add an option --size-level=1 in https://github.com/web-devkits/Wasmnizer-ts/blob/2f07034c74a0df2d4b3e6c8f069a7dcc33039048/tests/benchmark/run_benchmark.js#L184 and try again?

e.g.

execSync(`${wamrc} --size-level=1 --enable-gc -o ${prefix}.aot ${prefix}.wasm > tmp.txt`); 
beautiful-boyyy commented 9 months ago

Hi, I don't have a M2 MacOS now, could you please try to add an option --size-level=1 in

https://github.com/web-devkits/Wasmnizer-ts/blob/2f07034c74a0df2d4b3e6c8f069a7dcc33039048/tests/benchmark/run_benchmark.js#L184

and try again? e.g.

execSync(`${wamrc} --size-level=1 --enable-gc -o ${prefix}.aot ${prefix}.wasm > tmp.txt`); 

I added it in run_benchmark.js, same error. No "size-level" loged out, It's weird.

beautiful-boyyy commented 9 months ago

Hi, I don't have a M2 MacOS now, could you please try to add an option --size-level=1 in

https://github.com/web-devkits/Wasmnizer-ts/blob/2f07034c74a0df2d4b3e6c8f069a7dcc33039048/tests/benchmark/run_benchmark.js#L184

and try again? e.g.

execSync(`${wamrc} --size-level=1 --enable-gc -o ${prefix}.aot ${prefix}.wasm > tmp.txt`); 

I modified the run.sh, same error

LLVM ERROR: Only small, tiny and large code models are allowed on AArch64
./run.sh: line 46: 62318 Abort trap: 6           $wamrc --size-level=1 --enable-gc -o $prefix.aot $prefix.wasm > tmp.txt
Read file to buffer failed: open file binarytrees_class.aot failed.
xujuntwt95329 commented 9 months ago

According to https://github.com/bytecodealliance/wasm-micro-runtime/blob/a210b97cb599a8b857b5661aa223cea72b2e3e5a/core/iwasm/compilation/aot_llvm.c#L3011-L3019

It's strange, the default code model is LLVMCodeModelSmall, which should be allowed.

I noticed that --size-level=0 represents LLVMCodeModelLarge, could you try --size-level=0?

beautiful-boyyy commented 9 months ago

According to https://github.com/bytecodealliance/wasm-micro-runtime/blob/a210b97cb599a8b857b5661aa223cea72b2e3e5a/core/iwasm/compilation/aot_llvm.c#L3011-L3019

It's strange, the default code model is LLVMCodeModelSmall, which should be allowed.

I noticed that --size-level=0 represents LLVMCodeModelLarge, could you try --size-level=0?

thanks, solved