- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
using the evaluation version of the MKL, i have tested the accuracy of the matrix - matrix multiplication results of the sgemmby comparing them with the "simple" matrix - matrix multiplication. Simple here means:
float sum;
for (unsigned int i = 0; i < hA; ++i){
for (unsigned int j = 0; j < wB; ++j) {
sum = 0;
for (unsigned int k = 0; k < wA; ++k) {
sum += A[i * wA + k] * B[k * wB + j];
}
C[i * wB + j] = sum;
}
}
Comparing the results of the simple version and the MKL sgemm version, the failure percentage of sgemm lies in the range of 80% to 95 % with an average error of ca. 0.8 *10e-3 with randomly generated matrices uing the rand function from the stdlib.h and the matrix dimension 4096x4096.
Does someone know why the error precentage and the average error is that high ?
thanks in advance!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using compiler options which effectively force your C source to use K&R style double evaluation, you should get much better accuracy than you would get by optimizing for speed.
You would optimize for speed by using default int counters, and Intel compiler vectorizing options such as -xN. Then, you could regain accuracy at some cost in performance, by explicitly promoting to double, declaring
double sum
and
A[]* (double) B[]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, I would like to know how to determine the accuracy of the already implemented sgemm MKL methods.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not clear to me what you mean by "error". Certainly one way to measure the error would be to convert the single precision array to a double precision array and run dgemm, and then check the results of MKL sgemm against the double precision values. Since MKL BLAS functions are tested with the standard xBLATn tests, and pass those, I would be surprised if the test I just suggested would show anything surprising. In xBLATn, x is the precision (in this case S) and n is the level of the BLAS, in this case 3.
Please clarify how you measured the error. Using the "simple" case is not an adequate test since you do not know its properties.
Bruce

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