Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unreachable error running Benchmark test on M1 Mac #258

Closed
da1suk8 opened this issue Dec 16, 2022 · 2 comments
Closed

unreachable error running Benchmark test on M1 Mac #258

da1suk8 opened this issue Dec 16, 2022 · 2 comments
Assignees

Comments

@da1suk8
Copy link
Member

da1suk8 commented Dec 16, 2022

This PR is related to #250

After checking, this problem in the benchmark test was not specific to M1, but was caused by differences in machine performance.
Therefore, the problem is not specific to M1, but can be caused by the performance of Intel machines as well.

Summary

When test is executed, the following error occurs for M1.

$pwd
~/cosmwasm/packages/vm
$cargo bench --no-default-features --features bench -- --color never --save-baseline singlepass
Benchmarking DynamicLink/native_dynamic_link_trampoline with dummy contract_call
Benchmarking DynamicLink/native_dynamic_link_trampoline with dummy contract_call: Warming up for 3.0000 s
Benchmarking DynamicLink/native_dynamic_link_trampoline with dummy contract_call: Collecting 12 samples in estimated 10.000 s (12M iterations)
Benchmarking DynamicLink/native_dynamic_link_trampoline with dummy contract_call: Analyzing
DynamicLink/native_dynamic_link_trampoline with dummy contract_call
                        time:   [839.67 ns 848.11 ns 853.57 ns]
                        change: [-35.259% -26.509% -16.533%] (p = 0.00 < 0.05)
                        Performance has improved.
Benchmarking DynamicLink/native_dynamic_link_trampoline with mock cache environment
Benchmarking DynamicLink/native_dynamic_link_trampoline with mock cache environment: Warming up for 3.0000 s
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: RuntimeErr { msg: "Wasmer runtime error: RuntimeError: unreachable" }', packages/vm/benches/main.rs:286:64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This could be a problem with comswasm, or it could be a problem with INSTANCE_CACHE, a thread-local variable, or elsewhere.

However, when the thread is temporarily stopped by sleep!(), etc., test runs without error even in M1, so the cause may be around INSTANCE_CACHE, a thread-local variable.

Environment

$ rustup --version
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.63.0 (4b91a6ea7 2022-08-08)`
$ sysctl machdep.cpu.brand_string
machdep.cpu.brand_string: Apple M1 Pro
@da1suk8 da1suk8 changed the title unreachable error running Benchmark test fails on M1 Mac unreachable error running Benchmark test on M1 Mac Dec 16, 2022
@da1suk8 da1suk8 self-assigned this Dec 21, 2022
@da1suk8
Copy link
Member Author

da1suk8 commented Jan 17, 2023

At this time, the team has taken the decision that M1 Mac developers (or those with high-spec PCs) will not benchmark locally. This issue is low priority.

@da1suk8
Copy link
Member Author

da1suk8 commented Apr 25, 2023

Since INSTANCE_CACHE is no longer used, this problem is also solved.
And this benchmarking test(native_dynamic_link_trampoline with mock cache environment) is also deleated.

via: #294, #295, #296

@da1suk8 da1suk8 closed this as completed Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant