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

cargo bench --no-fail-fast -F=avx2 failed #43

Closed
3tieto opened this issue Dec 12, 2023 · 9 comments
Closed

cargo bench --no-fail-fast -F=avx2 failed #43

3tieto opened this issue Dec 12, 2023 · 9 comments
Assignees
Labels
bug Something isn't working compatibility

Comments

@3tieto
Copy link

3tieto commented Dec 12, 2023

image

     Running benches/hashset.rs (target/release/deps/hashset-e0bfa844d705dd83)
Gnuplot not found, using plotters backend
HashSet/u32/Default Hasher
                        time:   [16.380 ns 16.711 ns 17.067 ns]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
Benchmarking HashSet/u32/GxHash: Warming up for 3.0000 serror: bench failed, to rerun pass `--bench hashset`

Caused by:
  process didn't exit successfully: `/root/git/gxhash/target/release/deps/hashset-e0bfa844d705dd83 --bench` (signal: 4, SIGILL: illegal instruction)
     Running benches/ilp.rs (target/release/deps/ilp-18f7b97131886606)
Gnuplot not found, using plotters backend
baseline                time:   [134.34 µs 135.20 µs 136.28 µs]
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe

unrolled                time:   [129.67 µs 132.18 µs 136.40 µs]
Found 12 outliers among 100 measurements (12.00%)
  2 (2.00%) high mild
  10 (10.00%) high severe

temp                    time:   [54.313 µs 55.820 µs 57.345 µs]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

laned                   time:   [46.377 µs 47.916 µs 49.764 µs]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild

     Running benches/throughput/main.rs (target/release/deps/throughput-ce001a906bb8460b)
gxhash-avx2
error: bench failed, to rerun pass `--bench throughput`

Caused by:
  process didn't exit successfully: `/root/git/gxhash/target/release/deps/throughput-ce001a906bb8460b --bench` (signal: 4, SIGILL: illegal instruction)
     Running benches/throughput_criterion.rs (target/release/deps/throughput_criterion-c233dcb596180928)
Gnuplot not found, using plotters backend
Benchmarking all/gxhash-avx2/4: Warming up for 3.0000 serror: bench failed, to rerun pass `--bench throughput_criterion`

Caused by:
  process didn't exit successfully: `/root/git/gxhash/target/release/deps/throughput_criterion-c233dcb596180928 --bench` (signal: 4, SIGILL: illegal instruction)
error: 3 targets failed:
    `--bench hashset`
    `--bench throughput`
    `--bench throughput_criterion`
~/git/gxhash main                                                                                                                                                     1m 30s root@u2 13:43:20
❯ cargo bench --no-fail-fast -F=avx2
@3tieto
Copy link
Author

3tieto commented Dec 12, 2023

❯ RUST_BACKTRACE=1 cargo test -Favx2 -- --nocapture
    Finished test [unoptimized + debuginfo] target(s) in 0.12s
     Running unittests src/lib.rs (target/debug/deps/gxhash-db5f87006ff816b7)

running 20 tests
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/root/git/gxhash/target/debug/deps/gxhash-db5f87006ff816b7 --nocapture` (signal: 4, SIGILL: illegal instruction)

@ogxd
Copy link
Owner

ogxd commented Dec 12, 2023

Hi @3tieto,

On which branch are you? Are you on latest main?

This bug is supposed to be fixed since 2.3.0. There is even a test for it cargo test hasher_handles_empty_inputs --features avx2

If I run cargo bench --no-fail-fast -F=avx2 I do not have any issue on my end

@3tieto
Copy link
Author

3tieto commented Dec 12, 2023

image

❯ git log -1
commit 8e109d97538ca95123ba73368fba18bb54d90005 (HEAD -> main, tag: 2.3.0, origin/main, origin/HEAD)
Author: Olivier Giniaux <oginiaux@gmail.com>
Date:   Sun Dec 10 10:53:04 2023 +0100

    Add Hasher write_x primitives (#42)

    * Add specialized write_u32

    * Fix hashset benchmark accurracy

    * Implement all types

    * Fix build

    * Fix avx2

    * Add mandatory 0 length check to avoid SIGSEGV and add test

    * Version 2.3.0

    ---------

    Co-authored-by: Olivier Giniaux <oginiaux@smartadserver.com>
❯ rm -rf target

@ogxd
Copy link
Owner

ogxd commented Dec 12, 2023

Is it running in a virtualized environment? (I see QEMU)
Also, are other tests passing? (If you comment out hasher_handles_empty_inputs)

@3tieto
Copy link
Author

3tieto commented Dec 12, 2023

i run in my vps https://contabo.com/

use rustc 1.76.0-nightly (21cce21d8 2023-12-11)

always crash
image

@3tieto
Copy link
Author

3tieto commented Dec 12, 2023

i create a tmp user for this error
just
❯ ssh tmp@38.242.220.222
password PXeF5q53u9vo

cd ~/gxhash
run test

@ogxd
Copy link
Owner

ogxd commented Dec 12, 2023

Thx for the SSH.
The issue is that your machine does not support VAES:
image

See on my machine I have this flag:
image

The avx2 check is not sufficient. I thought avx2 implied vaes, but it seems it's not always the case. A check must be added in the code.

#[cfg(all(feature = "avx2", target_arch = "x86_64", target_feature = "avx2"))]

I'll patch this by adding the vaes check, even though the flag will remain named avx2 (which is misleading now)

This should be enough given that there won't be avx2 feature flag anymore with the hybrid gxhash #34

@ogxd ogxd added bug Something isn't working compatibility labels Dec 12, 2023
@ogxd ogxd self-assigned this Dec 12, 2023
@xxaier
Copy link

xxaier commented Dec 12, 2023

I look forward to the release of hybrid.

@ogxd
Copy link
Owner

ogxd commented Dec 24, 2023

Addressed with v3.0.0 (hybrid)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility
Projects
None yet
Development

No branches or pull requests

3 participants