Filter function returns different results on different GPUs
Show older comments
Hello,
I'm running into an issue where the built-in filter function returns different results on two different machines. One machine is running MATLAB 2022a and has a GeForce RTX 3080 Ti, the other is running 2018b and has a GeForce GTX 1070 Ti. The code being run to both is the line below - in each case, b1, a1, and dataRAW are the same, but filter returns different values.
datr = filter(b1, a1, dataRAW)
I think the source of the error has to do with the fact that dataRAW is a gpuArray object. In the code below, datr is the result of the filter function on the RTX PC, and dataRAW is the input data on the GTX PC. The first line returns false and the second returns true when both are run on the GTX PC.
isequal(filter(b1, a1, dataRAW), datr)
isequal(filter(b1, a1, gather(dataRAW)), datr)
Any ideas as to if/why the gpu may be creating a discrepancy here? The error between the results is quite large - the greatest difference is about 0.1755 which is not negligible for my application. Please let me know if I can clarify anything. Thanks!
5 Comments
Jan
on 12 May 2022
Rounding errors are expected. Filtering contains a summation and sums are numerically instable. The difference of "0.1755" is not meaningful without knowing the absolute values. This might still be near to eps of the actual values.
What are the types of the arrays: single or double?
Ziad Ali
on 12 May 2022
Ziad Ali
on 12 May 2022
Matt J
on 12 May 2022
I suggest attaching one .mat file containing a1, b1, dataRaw so we can test for ourselves.
Ziad Ali
on 12 May 2022
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!