Skip to content

linalg.eig and beta09 related changes#7

Merged
shssf merged 5 commits into
masterfrom
linalg-eig-beta09
Sep 11, 2020
Merged

linalg.eig and beta09 related changes#7
shssf merged 5 commits into
masterfrom
linalg-eig-beta09

Conversation

@Alexander-Makaryev
Copy link
Copy Markdown
Contributor

I missed this PR
#5
beta9 is required for work with linalg.eig in any case.

Test shows issues and difference between current (mkl::lapack::syevd) and original implementations.
tests/test_linalg.py::test_eig_arange[2-float64] PASSED[ 5%]
tests/test_linalg.py::test_eig_arange[2-float32] PASSED[ 10%]
tests/test_linalg.py::test_eig_arange[2-int64] PASSED[ 15%]
tests/test_linalg.py::test_eig_arange[2-int32] PASSED[ 20%]
tests/test_linalg.py::test_eig_arange[4-float64] PASSED[ 25%]
tests/test_linalg.py::test_eig_arange[4-float32] FAILED[ 30%]
tests/test_linalg.py::test_eig_arange[4-int64] PASSED[ 35%]
tests/test_linalg.py::test_eig_arange[4-int32] PASSED[ 40%]
tests/test_linalg.py::test_eig_arange[8-float64] PASSED[ 45%]
tests/test_linalg.py::test_eig_arange[8-float32] FAILED[ 50%]
tests/test_linalg.py::test_eig_arange[8-int64] PASSED[ 55%]
tests/test_linalg.py::test_eig_arange[8-int32] PASSED[ 60%]
tests/test_linalg.py::test_eig_arange[16-float64] PASSED[ 65%]
tests/test_linalg.py::test_eig_arange[16-float32] FAILED[ 70%]
tests/test_linalg.py::test_eig_arange[16-int64] PASSED[ 75%]
tests/test_linalg.py::test_eig_arange[16-int32] PASSED[ 80%]
tests/test_linalg.py::test_eig_arange[300-float64] FAILED[ 85%]
tests/test_linalg.py::test_eig_arange[300-float32] FAILED[ 90%]
tests/test_linalg.py::test_eig_arange[300-int64] FAILED[ 95%]
tests/test_linalg.py::test_eig_arange[300-int32] FAILED[100%]

Comment thread tests/test_linalg.py
Comment on lines +43 to +52
# DPNP sort val/vec by abs value
vvsort(dpnp_val, dpnp_vec, size)

# NP sort val/vec by abs value
vvsort(np_val, np_vec, size)

# NP change sign of vectors
for i in range(np_vec.shape[1]):
if np_vec[0, i] * dpnp_vec[0, i] < 0:
np_vec[:, i] = -np_vec[:, i]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not quite clear why we need this code.
If you need to compare numpy and dpnp return values - no further changes needed in these arrays

Comment thread dpnp/linalg/linalg.pyx
res_vec[i] = in_array1[i]

if call_type == numpy.float64:
if call_type in [numpy.float64, numpy.int32, numpy.int64]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like it might fails here. The kernel will treat data as double* (8 bytes) but real array contains int * (4 bytes)

Comment thread dpnp/backend/mkl_wrap_lapack.cpp Outdated
@@ -42,55 +42,23 @@ void mkl_lapack_syevd_c(void* array_in, void* result1, size_t size)

auto queue = DPNP_QUEUE;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto &queue = DPNP_QUEUE;

@shssf
Copy link
Copy Markdown
Contributor

shssf commented Sep 10, 2020

is it possible to remove using namespace oneapi from this PR?

@shssf shssf merged commit 4031f64 into master Sep 11, 2020
@shssf shssf deleted the linalg-eig-beta09 branch September 11, 2020 18:15
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

Successfully merging this pull request may close these issues.

2 participants