Fixes to mean and better precision on sum (cpu) #3687
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When strided weights are used, the mean function typically returned random results.
The produced result of mean is no longer dependent on platform or processing style (linear, strided, on CPU or GPU)
Description
b74f28f sum on CPU now has the same precision as other platforms
With this introduction, the difference in result of a linear array and strided array is minimal. The precision in the tests are as a result improved.
As result, the precision of many tests can be improved now since all platforms generate similar results, independent from parallel or serial processing.
9307d6f Fixes to mean, on all platforms
All:
With this introduction, the difference in result of a linear array and strided array is minimal. The precision in the tests are as a result improved.
CPU:
CUDA:
ONEAPI:
OPENCL:
TEST:
- extra tests added on all temporary formats.
- allowed fault tolerance for tests is lowered, since now the correct mean is calculated for all backends.
- MeanAllTest now uses random data iso constants for testing. This blocked the detection of partial processing of the input.
Additional information about the PR answering following questions:
Fixes:
Changes to Users
Better precision in all circumstances, and independent form platform or array format.
Checklist