- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please explain if MKL_F16 is equivalent to the 16-bit floating-point type (i.e. half) ?
Running the example does not produce the expected output for MKL_F16.
https://github.com/zjin-lcf/HeCBench/tree/master/src/blas-gemm-omp
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The MKL_F16 datatype is defined in the public header mkl_types.h to be the same as "unsigned short" (we do some conversions internally) so when you are setting the initial matrix and alpha, beta you are not getting the numbers you expect.
The simplest way to fix this in your linked example is probably to use _Float16 as your working type:
run_gemm_example<_Float16>(m, k, n, repeat);
and then cast the pointers to MKL_F16 in the actual gemm call:
hgemm("N", "N", &n, &m, &k, (MKL_F16*) &alpha, (MKL_F16*) b, &n, (MKL_F16*) a, &k, (MKL_F16*) &beta, (MKL_F16*) c, &n);
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The MKL_F16 datatype is defined in the public header mkl_types.h to be the same as "unsigned short" (we do some conversions internally) so when you are setting the initial matrix and alpha, beta you are not getting the numbers you expect.
The simplest way to fix this in your linked example is probably to use _Float16 as your working type:
run_gemm_example<_Float16>(m, k, n, repeat);
and then cast the pointers to MKL_F16 in the actual gemm call:
hgemm("N", "N", &n, &m, &k, (MKL_F16*) &alpha, (MKL_F16*) b, &n, (MKL_F16*) a, &k, (MKL_F16*) &beta, (MKL_F16*) c, &n);

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