-
Notifications
You must be signed in to change notification settings - Fork 165
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
[BLAS] add interfaces to matrix copy/transposition routines #227
[BLAS] add interfaces to matrix copy/transposition routines #227
Conversation
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.
Thanks for the PR! It looks good overall. I have two comments:
- Could you please fix the layout namespaces in couple places?
- We need to write our own reference implementation for new APIs, so that we can actually check correctness.
Thanks for the review @mmeterel , I think I have addressed your comments. |
namespace { | ||
|
||
template <typename fp> | ||
void imatcopy_ref(oneapi::mkl::layout layout, oneapi::mkl::transpose trans, int64_t m, int64_t n, |
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.
Can we move the reference implementations to this common place (tests/unit_tests/blas/include/reference_blas_templates.hpp
), along with other reference implementation?
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.
Done, good idea!
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.
Looks good. Thanks!
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.
A few comments but nothing blocking.
And, #pragma once
may suffice for header guard. But to date, both ways are used across the project.
fp alpha, beta; | ||
int64_t i, tmp; | ||
|
||
batch_size = 1 + std::rand() % 20; |
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.
I am unsure this be the same random number every time.
Do we want reproducibility of random batch size?
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.
In general, if something in a test were to fail. Is knowing the exact values useful for reproducing.
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.
In this case, transpose APIs, there is probably not a concern.
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.
And lastly, _precondition and _postcondition may not be necessary since they are stubs.
Then again, to match the rest of pre-existing BLAS it makes sense to include them here.
No changes required. Just some observations. Thank you, @andrewtbarker
Description
This PR adds interfaces for batch strided matrix copy/transposition routines
omatcopy
,imatcopy
, andomatadd
.Currently the non-batch routines are not fully document/implemented in the oneMKL product, when they are we will add interfaces to them as well. At that point we will also implement the cublas and rocblas backends via their
geam
interfaces where appropriate.Checklist
All Submissions
New interfaces
it was accepted? #420
New features
test-cublas.txt
test-mklbackend.txt