Effacer les filtres
Effacer les filtres

Matrix multiplication not returning on certain matrix content (Intel)

91 vues (au cours des 30 derniers jours)
Philipp
Philipp le 10 Avr 2024 à 13:27
Modifié(e) : Bruno Luong le 11 Avr 2024 à 20:06
Hi,
I have a certain matrix multiplication which is not returning on my Intel machine (Win11 Pro, Intel i7-8700). When I exchange the content of the matrices with random numbers I can obtain a result within seconds. I could reproduce this problem on several Intel machines (and different Matlab versions). I relate this problem to Intel MKL. One matrix contains a lot of entries close to zero (10^-322) which probably causes the problem.
To reproduce it, download the two matrices:
and run the command:
scc=At*scc;
Is this operation running through on your machine?
  2 commentaires
John D'Errico
John D'Errico le 10 Avr 2024 à 14:23
It is generally a bad idea to force someone to download a file from off-site. We don't know if you are planting a trojan on our system. Honestly, I won't touch it to test your question as a download. Maybe others will be more willing to take a chance on an unknown person, posting a link to an unkown file. I hope they don't take the risk since you could have made this much simpler.
Just attach a .mat file that contains the matrices. Click on the paper clip icon on a comment.
Philipp
Philipp le 10 Avr 2024 à 14:30
It's about 4 GB and I don't know if I can reproduce it on any other size and I have no intent to invest any more time into this. The provided link directs to a German university (over https) with a download service for larger files. The university scans the files internally for viruses. It's the best I can do.

Connectez-vous pour commenter.

Réponses (1)

Bruno Luong
Bruno Luong le 10 Avr 2024 à 14:56
Modifié(e) : Bruno Luong le 10 Avr 2024 à 14:59
The matrix contains many non normalized floating point numbers and operations on these numbers are very slow;
>> load('C:\Users\bruno\Downloads\test.mat')
>> size(At)
ans =
17534 17532
>> size(scc)
ans =
17532 8281
>> tic; B=At*scc(:,1); toc
Elapsed time is 1.105924 seconds.
>> tic; B=At*scc(:,1:10); toc
Elapsed time is 10.237435 seconds.
>> tic; B=At*scc(:,1:100); toc
Elapsed time is 108.484422 seconds.
On my machine it takes 1 sec by column of scc. So eventually I guess it will finish in less than 3h.
Note that for normalized numbers the operation is roughly 200 time faster.
So for now I think there is no bug. Just let the thing run over night (Sorry I won't do that).
  13 commentaires
Walter Roberson
Walter Roberson le 11 Avr 2024 à 19:26
Hmmm... I wonder if the hardware could convert the numbers to 80 bit floats, do the operation, and convert back?
Bruno Luong
Bruno Luong le 11 Avr 2024 à 19:56
Modifié(e) : Bruno Luong le 11 Avr 2024 à 20:06
Certainly a very nice idea. But one of the reasons: As the exponet has only 4 more bits, its is still not enough to convert all denormalized 64 bits numbers to normalized 80 bits. It needs +6 bits exponent since 2^6 >= 52 > 2^5 > 2^4

Connectez-vous pour commenter.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits


Version

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by