-
Notifications
You must be signed in to change notification settings - Fork 22
using syrk
for performing special cases of matrix multiplication
#2509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
View rendered docs @ https://intelpython.github.io/dpnp/pull/2509/index.html |
Array API standard conformance tests for dpnp=0.19.0dev0=py313h509198e_45 ran successfully. |
} | ||
|
||
// kernel to copy upper triangle to lower triangle | ||
sycl::event copy_event = exec_q.submit([&](sycl::handler &h) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an option we can test with the work-groups:
static constexpr std::size_t tile_sz = 16; // Tile size
sycl::range<2> global_range(Align(n, tile_sz), Align(n, tile_sz));
sycl::range<2> local_range(tile_sz, tile_sz);
// kernel to copy upper triangle to lower triangle
sycl::event copy_event = exec_q.submit([&](sycl::handler &h) {
h.depends_on(syrk_event);
h.parallel_for(sycl::nd_range<2>(global_range, local_range), [=](sycl::nd_item<2> item) {
int i = item.get_global_id(0);
int j = item.get_global_id(1);
if (i < n && j < n && i > j) {
#if defined(USE_ONEMATH_CUBLAS)
res[i * ldc + j] = res[j * ldc + i];
#else
if (is_row_major) {
res[i * ldc + j] = res[j * ldc + i];
} else {
res[j * ldc + i] = res[i * ldc + j];
}
#endif // USE_ONEMATH_CUBLAS
}
});
});
but we need to discover a proper tile_sz
, based on device
In this PR, the
syrk
routines from oneMKL is used to perform a rank-k update which is used for a specialized matrix multiplication where the result is a symmetric matrix.