dnnl_get_effective_cpu_isa on Aarch64
Hello. There are a couple of new tests in the CI suite that are failing on Aarch64, specifically:
The following tests FAILED:
90 - test_internals_env_vars_dnnl (Failed)
91 - test_internals_env_vars_onednn (Failed)
I've attached the verbose output further down [1].
I can see this is because, on Aarch64, dnnl_get_effective_cpu_isa is returning 1 (instead of 0), which I believe is dnnl_cpu_isa_sse41 (instead of dnnl_cpu_isa_all)? This looks like incorrect behaviour but I am not sure why this is happening...
I can workaround the test failure by doing something like this:
but again I'm not sure that this is the right way to do it.
Thanks! Diana
[1]
$ ctest -j54 --verbose -R test_internals_env_vars_dnnl
[...]
92: Test command: /home/diabit01/oneDNN/build/tests/gtests/internals/test_internals_env_vars_dnnl
92: Test timeout computed to be: 10000000
92: [==========] Running 4 tests from 4 test suites.
92: [----------] Global test environment set-up.
92: [----------] 1 test from dnnl_max_cpu_isa_env_var_test
92: [ RUN ] dnnl_max_cpu_isa_env_var_test.TestEnvVars
92: /home/diabit01/oneDNN/tests/gtests/internals/test_env_vars_dnnl.cpp:62: Failure
92: Expected equality of these values:
92: got
92: Which is: 1
92: dnnl_cpu_isa_all
92: Which is: 0
92: [ FAILED ] dnnl_max_cpu_isa_env_var_test.TestEnvVars (1 ms)
92: [----------] 1 test from dnnl_max_cpu_isa_env_var_test (1 ms total)
92:
92: [----------] 1 test from dnnl_cpu_isa_hints_var_test
92: [ RUN ] dnnl_cpu_isa_hints_var_test.TestEnvVars
92: [ OK ] dnnl_cpu_isa_hints_var_test.TestEnvVars (0 ms)
92: [----------] 1 test from dnnl_cpu_isa_hints_var_test (0 ms total)
92:
92: [----------] 1 test from dnnl_primitive_cache_capacity_env_var_test
92: [ RUN ] dnnl_primitive_cache_capacity_env_var_test.TestEnvVars
92: [ OK ] dnnl_primitive_cache_capacity_env_var_test.TestEnvVars (0 ms)
92: [----------] 1 test from dnnl_primitive_cache_capacity_env_var_test (0 ms total)
92:
92: [----------] 1 test from dnnl_default_fpmath_mode_env_var_test
92: [ RUN ] dnnl_default_fpmath_mode_env_var_test.TestEnvVars
92: [ OK ] dnnl_default_fpmath_mode_env_var_test.TestEnvVars (0 ms)
92: [----------] 1 test from dnnl_default_fpmath_mode_env_var_test (0 ms total)
92:
92: [----------] Global test environment tear-down
92: [==========] 4 tests from 4 test suites ran. (1 ms total)
92: [ PASSED ] 3 tests.
92: [ FAILED ] 1 test, listed below:
92: [ FAILED ] dnnl_max_cpu_isa_env_var_test.TestEnvVars
92:
92: 1 FAILED TEST
1/1 Test #92: test_internals_env_vars_dnnl .....***Failed 0.01 sec
0% tests passed, 1 tests failed out of 1
Hi @diaena, thanks for reporting this issue.
My understanding is that mayiuse call while getting isa receives "trash" (for Aarch64) env var value, sets isa_all internal type flag which means take best what you can, and asimd is picked up with value of 1 (one more internal type used as a "temporary" :) solution). That's where 1 should come from. I'm running debug PR to check if my understanding is right and if it is, then your workaround makes total sense to me and I'll promote it to branches where new tests were added.
Thank you and sorry for inconveniences.
P.S. I don't remember when adding new gtests wouldn't result in any failure in public CI...
Thank you!