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

norm2 test failing on Kokkos impl #224

Open
mzuzek opened this issue May 27, 2022 · 4 comments
Open

norm2 test failing on Kokkos impl #224

mzuzek opened this issue May 27, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@mzuzek
Copy link

mzuzek commented May 27, 2022

@mhoemmen @fnrizzi
norm2 native test fails when executed on Kokkos implementation (with LINALG_ENABLE_KOKKOS_DEFAULT=ON), e.g. see this CI job:

      Start 14: norm2
15/36 Test #14: norm2 ................................***Failed    0.01 sec
Running main() from /home/runner/work/stdBLAS/stdBLAS/build/stdblas/_deps/googletest-src/googletest/src/gtest_main.cc
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from BLAS1_norm2
[ RUN      ] BLAS1_norm2.mdspan_zero
[       OK ] BLAS1_norm2.mdspan_zero (0 ms)
[ RUN      ] BLAS1_norm2.mdspan_one
/home/runner/work/stdBLAS/stdBLAS/src/stdblas/tests/native/norm2.cpp:85: Failure
Expected equality of these values:
  expectedNormResult + mag_t(1.0)
    Which is: 4
  normResultPlusOne
    Which is: 3.16228
[  FAILED  ] BLAS1_norm2.mdspan_one (0 ms)
[ RUN      ] BLAS1_norm2.mdspan_double
[       OK ] BLAS1_norm2.mdspan_double (0 ms)
[ RUN      ] BLAS1_norm2.mdspan_complex_double
[       OK ] BLAS1_norm2.mdspan_complex_double (0 ms)
[----------] 4 tests from BLAS1_norm2 (0 ms total)

[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (0 ms total)
[  PASSED  ] 3 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] BLAS1_norm2.mdspan_one

 1 FAILED TEST
@mzuzek mzuzek added the bug Something isn't working label May 27, 2022
@mzuzek
Copy link
Author

mzuzek commented May 27, 2022

@mhoemmen @fnrizzi

According to P1673R8, norm2 should use:

vector_sum_of_squares(x, {.scaling_factor=1.0, .scaled_sum_of_squares=init})

Instead the current serial implementation uses:

vector_sum_of_squares(x, {.scaling_factor=0.0, .scaled_sum_of_squares=1.0})

and then includes init outside sqrt()...

That could be easy to fix, but just below we have the current serial implementation of vector_sum_of_squares() which is doing even stranger things in the calculation (e.g. accumulating squares of reversed values: 1/abs(x[i])), so it's not trivial/immediate for me to address.

@mzuzek
Copy link
Author

mzuzek commented May 27, 2022

@mhoemmen @fnrizzi

In P1673R8 we have:
typos

  1. sounds like init should be squared too;
  2. there is no A in norm2 - should it be v ?

@fnrizzi
Copy link
Contributor

fnrizzi commented May 28, 2022

Issue 141 is opened and related to this

@mzuzek
Copy link
Author

mzuzek commented May 28, 2022

Thanks @fnrizzi!
If that's a known bug (and out of current scope ?), maybe we should disable norm2 test for now and add re-enabling it to the TODOs here in the issue?

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

No branches or pull requests

2 participants