-
Notifications
You must be signed in to change notification settings - Fork 218
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
Reordering dimensions using miopenTransformTensor is broken #2828
Comments
@t4c1 Thanks for clear instructions. Please let us know the importance of this issue for you; that would help us to prioritize our work. Related ticket: #1704 /cc @averinevg @junliume @shurale-nkn @CAHEK7 @JehandadKhan @xinlipn @technicalgrp89 |
@junliume @JehandadKhan Can you please set the appropriate priority label and assign this to an engineer. |
Checking up on this - has there been any progress? |
@t4c1 Sorry for delays. It seems like miopenTransformTensor works incorrectly if destination buffer contains junk (which is weird because beta = 0). Please try if |
@ShanoToni please see previous comment |
@ShanoToni @t4c1 Reproducer 1 works without problems if workaround (mentioned at #2828 (comment)) is applied. Reproducer 2 contains bugs: hipMalloc(&src_dev, src_dims[0] * src_dims[1] * dt_size); // Bug: src_dims[2] and [3] are not observed
// -> space for only 2 elements allocated. as a result, both hipMemcpy calls failed. Failures are not caught because return codes aren't checked. Simplest fix: #define EC(expr) \
do \
{ \
auto rc = (expr); \
if(rc != 0) \
{ \
std::cerr << "HIP call failed: '" #expr "', rc = " << rc << std::endl; \
} \
} while(false)
...
const auto nelem =
std::accumulate(std::begin(src_dims), std::end(src_dims), 1ULL, std::multiplies<size_t>());
const auto bufsize = nelem * DT_SIZE;
...
EC(hipMalloc(&src_dev, bufsize)); With these fixes (plus workaround) reproducer 2 also works correctly. Please expect PR that eliminates the need for a workaround that cleans output buffer. /cc @junliume |
#3184 is merged in. Please check that reproducers work correctly with our |
Attaching two reproducers:
miopenSetTensorDescriptor
. Attempting to change the order of dimensions copies the data, but it is not reordered.miopenSetNdTensorDescriptorWithLayout
and attempts to change order from NCHW to NHWC. In this case no data seems to be copied to the second tensor.Reproducer 1:
Reproducer 2:
The text was updated successfully, but these errors were encountered: