Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- SVD runs very slow and sometimes doesn't return for matrices which cannot converge

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Huang_X_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-25-2014
02:46 PM

65 Views

SVD runs very slow and sometimes doesn't return for matrices which cannot converge

Hi Guys

I have been struggling with the MKL SVD computation recently. So I really appreciate if anyone can help out.

Basically I am using MKL SVD to calculate the first two eigenvectors for a matrix. I use the LAPACK_dgesvd method in the MKL to do the job. It runs fairly fast for matrix which can converge. But for those who can't converge, MKL SVD runs extremely slow and sometimes it never return. I am not sure what is going on behind the scene. Maybe MKL just tries exhaustively when the matrix can't converge?

My questions is:

1. If there is any method which can just compute two eigenvectors rather than all of them?

2. if there is a way to set the max iteration for SVD computation or timeout when matrix cannot converge.

thank you very much in advance.

Link Copied

5 Replies

Alexander_K_Intel3

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-26-2014
02:46 AM

65 Views

Hello,

You also could try LAPACKE_dgesdd, which utilizes Divide and Conquer method and should be faster. If it didn't converge it returns an error.

We don't expect LAPACKE_dgesvd to hang even in worst case, it also should return convergence error. Could you please help us to reproduce the case.

We don't have functionality to extract only few singular values. And this case not much faster than full SVD since major steps of SVD have to be computed anyway.

Thanks, Alexander

Huang_X_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-26-2014
10:52 AM

65 Views

Hi Alexander

Thank you so much for your reply. I think it is really helpful that you point out the dgesdd.

Also, I am sorry for the confusion. I don't think MKL hangs, it is still running but just takes very long time to return so I had to manually kill the process. In my own SVD implementation, I set the max iteration to be 100. If the max iteration is exceeded, I will just give up the computation and return. Is there a way to do the similar thing in MKL SVD? I don't want the computation to run for very long time to get the results. If within some time or some iterations, there are no converged results, MKL can just give up and return error info. Thank you again for your help.

Ying_H_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-27-2014
12:36 AM

65 Views

Hello Huang X.

Could you provide us a small test case (include the input matrix) to reproduce the no-converge problem. We doubt it may be a bug, So a test case will be helpful.If the test case is confidential, you can email us by Send Author A message.

Thanks

Ying

Huang_X_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-27-2014
11:04 PM

65 Views

Hi Ying

Thank you so much for your reply. It actually turns out to be the JNI badness for the problem. dgesvd can actually return even there is no-converge. Now I moved to dgesdd and it is amazing fast. Sorry for the confusion and also thanks a lot for the help. I have one more question though, I am only using SVD computation in MKL. But I need to package the entire MKL into my application which is a bit big. Can I just package the libs needed by MKL?

Ying_H_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-28-2014
12:01 AM

65 Views

Hello Huang X,

Nice to know this results.

Regarding the package, how do you link the MKL into your program? I guess, you may create a custom dll (name it as your.dll/so), which link MKL static library. Then you don't need packag the entire MKL into your application. And your.dll /so will support SVD computation.

You can create your custom dll file. Or use the build tools under MKL install directory, i.e C:\Program Files (x86)\Intel\Composer XE 2013\mkl\tools\builder, edit the user_example_list, then build. Please see more detials in MKL user guide.

Best Regards,

Ying

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.