이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Weird behavior for pagemrdivide matlab 2022b vs 2022a
조회 수: 4 (최근 30일)
이전 댓글 표시
I am noticing some strange behaviour when using pagemrdivide. When I run the code below, the Dpage variable contains a lot of NaN, while the Dfor variable computes just fine. I expect these two to be equal, but they are not. Has anyone else encountered this behaviour before?
When I run the same code in matlab 2022a, I don't get this behaviour, it seems to be introduced in 2022b.
F = 300;
D = randn(2,2,F) + 1i*randn(2,2,F);
P = [0 0 1 0
1 0 0 0
0 0 0 1
0 -1 0 0];
P11 = P(1:2,1:2);
P12 = P(1:2,3:4);
P21 = P(3:4,1:2);
P22 = P(3:4,3:4);
Dpage = pagemrdivide(pagemtimes(P11,D) + P12, pagemtimes(P21,D)+P22);
Dfor = zeros(size(D));
for ff = 1 : F
Dfor(:,:,ff) = mrdivide(P11*D(:,:,ff)+P12,P21*D(:,:,ff)+P22);
end
nnz(isnan(Dpage))
ans = 600
nnz(isnan(Dfor))
ans = 0
댓글 수: 13
Walter Roberson
2022년 12월 21일
You are right, it is pretty bad, giving all nan and inf results if asked to process more than one page
format long g
D = cat(3, [1 2; 3 4], [2 -1; 3 5]) + 1i*cat(3, [20 19; 18 17], [-1 5; 7 9])
P = [0 0 1 0
1 0 0 0
0 0 0 1
0 -1 0 0];
P11 = P(1:2,1:2);
P12 = P(1:2,3:4);
P21 = P(3:4,1:2);
P22 = P(3:4,3:4);
arg1 = pagemtimes(P11,D) + P12
arg2 = pagemtimes(P21,D) + P22
Dpage = pagemrdivide(arg1, arg2)
Dpage2 = cat(3, pagemrdivide(arg1(:,:,1), arg2(:,:,1)), pagemrdivide(arg1(:,:,2), arg2(:,:,2)))
nnz(isnan(arg1))
nnz(isnan(arg2))
nnz(isnan(Dpage))
nnz(isnan(Dpage2))
The debugging confirms that it is not the fault of pagemtimes, and confirms that if you only do one page at a time that the problem does not occur.
the cyclist
2022년 12월 22일
Seems to be pretty clear-cut bug, introduced in R2022b. (The function itself was only introduced in R2022a!)
Paul
2022년 12월 22일
Also, pagemldivide doesn't work for @Walter Roberson's example. Pehaps even worse, pagemldivide on multiple pages doesn't yield a result that's obviously incorrect, i.e., with nan or inf entries. Just returns realistic looking, but incorrect, numbers for a few entries.
format long g
D = cat(3, [1 2; 3 4], [2 -1; 3 5]) + 1i*cat(3, [20 19; 18 17], [-1 5; 7 9]);
P = [0 0 1 0
1 0 0 0
0 0 0 1
0 -1 0 0];
P11 = P(1:2,1:2);
P12 = P(1:2,3:4);
P21 = P(3:4,1:2);
P22 = P(3:4,3:4);
arg1 = pagemtimes(P11,D) + P12;
arg2 = pagemtimes(P21,D) + P22;
Both pages at once
Dpage = pagemldivide(arg1, arg2)
Dpage =
Dpage(:,:,1) =
0 + 0i 1 + 0i
-0.953424657534247 + 0.0575342465753425i -0.906849315068493 + 0.115068493150685i
Dpage(:,:,2) =
0 + 0i 1 + 0i
-1.23076923076923 + 0.846153846153846i -1.53846153846154 + 1.30769230769231i
Use plain vanilla mldivide
Dpage1 = cat(3,arg1(:,:,1)\arg2(:,:,1),arg1(:,:,2)\arg2(:,:,2))
Dpage1 =
Dpage1(:,:,1) =
0 + 0i 1 + 0i
-0.953424657534247 + 0.0575342465753425i -1.95342465753425 + 0.0575342465753425i
Dpage1(:,:,2) =
0 + 0i 1 + 0i
-1.23076923076923 + 0.846153846153846i -1.26923076923077 + 1.65384615384615i
pagemldivide one page at a time.
Dpage2 = cat(3, pagemldivide(arg1(:,:,1), arg2(:,:,1)), pagemldivide(arg1(:,:,2), arg2(:,:,2)))
Dpage2 =
Dpage2(:,:,1) =
0 + 0i 1 + 0i
-0.953424657534247 + 0.0575342465753425i -1.95342465753425 + 0.0575342465753425i
Dpage2(:,:,2) =
0 + 0i 1 + 0i
-1.23076923076923 + 0.846153846153846i -1.26923076923077 + 1.65384615384615i
nnz(isnan(arg1))
ans =
0
nnz(isnan(arg2))
ans =
0
nnz(isnan(Dpage))
ans =
0
nnz(isnan(Dpage2))
ans =
0
Dpage - Dpage1
ans =
ans(:,:,1) =
0 + 0i 0 + 0i
0 + 0i 1.04657534246575 + 0.0575342465753425i
ans(:,:,2) =
0 + 0i 0 + 0i
0 + 0i -0.269230769230769 - 0.346153846153846i
Dpage - Dpage2
ans =
ans(:,:,1) =
0 + 0i 0 + 0i
0 + 0i 1.04657534246575 + 0.0575342465753425i
ans(:,:,2) =
0 + 0i 0 + 0i
0 + 0i -0.269230769230769 - 0.346153846153846i
Dpage1 - Dpage2
ans =
ans(:,:,1) =
0 0
0 0
ans(:,:,2) =
0 0
0 0
Any thoughts on checking the other page* functions?
Adam
2022년 12월 22일
Thanks for the quick replies, I will file a bug report with the mathworks and refer to this page in it.
Paul
2022년 12월 22일
Would you mind posting back here the outcome of your interaction with Tech Support?
Adam
2022년 12월 22일
I got the following reply from Tech support.
Thanks for reporting this issue. I can also reproduce it in R2022b and R2023a Prerelease.
As far as I can see a colleague already saw the MATLAB Answers post and created an internal bug report.
I will link your case to it, so you will be notified when the bug was fixed.
Besides this I will nominate this bug for a R2022b update release.
So it seems we can expect a fix for this quite soon via an update.
I will update when I get some more information
Paul
2022년 12월 22일
Thanks! I always find it interesting when they find something worthy of an "internal bug report," but don't list it on the the external Bugs page. The criteria for what's shown on that page has always been a mystery to me.
Adam
2022년 12월 23일
Yeah, also, I would expect that a change to the function shows up in the Version History part of the documentation for that function. The pagemrdivide page does not list any change to the function, so we were not expecting any change during debugging of this issue and lost quite a lot of time due to this.
The pagemldivide page does mention a performance increasing change in its version history, maybe they also touched mrdivide with this change.
Heiko Weichelt
2022년 12월 23일
Thanks for reporting this. The external bug report is under review and will be published shortly (modulo holiday break).
We identified and fixed the issue and working on getting the fix out as soon as possible.
When introduced in R2022a, pagemldivide/pagemridivide only distingished between rectangular -> using QR and square -> using LU. In R2022b, we unified pagemldivide/pagemrdivide and mldivide/mrdivide using the same algorithms underneath (a few exceptions apply; compare https://www.mathworks.com/help/matlab/ref/pagemldivide.html#mw_b5069599-8b9b-4941-934f-c94c53d4dd56 with https://www.mathworks.com/help/matlab/ref/mldivide.html#bt4jslc-6).
The algorithm detecting the structure introduced the faulty behavior for complex inputs of a certain structure.
Paul
2023년 1월 16일
@Adam or anyone else ....
Any new information on this issue? I still don't see the external bug report on the bug reports page.
Adam
2023년 1월 17일
I am also still waiting for news about the issue.
They closed my ticket because of the existing internal ticket, but that means there is no information available
Heiko Weichelt
2023년 1월 19일
EBR is online:
As mentioned before, R2022b Update 4, which will be released in a few days, will contain the fix.
답변 (1개)
Adam Danz
2023년 1월 18일
편집: Adam Danz
2023년 1월 18일
Be on the lookout for the next update (update 4) to MATLAB R2022b.
3 Ways to check for MATLAB Updates
- From MATLAB Desktop, go to the home tab and select the dropdown menu under Help, then select "Check for Updates".
- Look for a red bell in the upper right corner of the desktop (it's gray when there are no available updates). Click it.
- Check the manual download page https://www.mathworks.com/downloads/, Select "Get Updates" from the "I WANT TO" dropdown menu.
댓글 수: 10
Paul
2023년 1월 18일
Are you willing and able to comment on why this bug isn't listed on the bug reports page?
More generally, are you willing and able to explain the criteria TMW uses to determine which bugs to share or not share with their customers on the bug reports page?
Adam Danz
2023년 1월 18일
I'm not a spokesman for MW, I just like to help folks out in between tasks or when I'm on a break :)
Paul
2023년 1월 18일
Thanks for the link, never saw that before.
And thanks for helping folks out when you're on break! You should take more breaks.
I realize you can't comment on this, but:
"Published bug reports are for bugs that have been reported in this system that may be of interest to customers, based on general use of our products."
Seems like this bug would qualify, considering that many of othe bug reports are much, much more esoteric IMO as compared to core functionality like matrix division.
Bruno Luong
2023년 1월 18일
The reason might be that TMW has internal bug ticket before it has been officialy reported from us (Adam). One bug one ticket.
The bug is beeing fixed and will be released in Update 4, the next one, probably in few days or weeks. What else do you want to know?
Paul
2023년 1월 18일
I want to know why this bug is not considered worthy of being on the external bugs page. And I want to know how TMW determines, in general, which bugs "may be of interest to customers." My concern is about the process, not the status of this bug.
Bruno Luong
2023년 1월 19일
편집: Bruno Luong
2023년 1월 19일
You imply that *this* bug is not logged externally because they think is not of interested to costumers, which perhaps not correct. Here is the reason
"They closed my ticket because of the existing internal ticket"
Secondly you need to talk to the specific person who has decided the bug is not logged externally and speak in the public place.
If you have experience in the large corporate as TMW you will know that is not going to happen.
Steven Lord
2023년 1월 19일
We are working on writing, reviewing, and publishing the bug report for this bug. It's taking longer than expected due to the holidays (as Heiko indicated) and other factors unrelated to whether or not this is "of interest to customers." I will make sure that when it is published either Heiko or I post a comment linking to it.
Heiko Weichelt
2023년 1월 19일
EBR is online:
As mentioned before, R2022b Update 4, which will be released in a few days, will contain the fix.
Bruno Luong
2023년 1월 19일
편집: Bruno Luong
2023년 1월 19일
@Heiko Weichelt thanks.
It looks pretty similar to this one. If you need me to fire a bug report I'll happy to do it.
Heiko Weichelt
2023년 1월 19일
I was not aware of this but GPU code is separate and not my expertise. I'll poke some of my colleagues about it. Thanks.
참고 항목
카테고리
Help Center 및 File Exchange에서 Install Products에 대해 자세히 알아보기
태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)