flame / blis

BLAS-like Library Instantiation Software Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

*omatcopy_ct input parameter checking

markbmuller opened this issue · comments

When using a downloaded AMD precompilled blis library and calling domatcopy to perform a transpose copy, I have received the following error message:

libblis: /home/amd/jenkins/workspace/AOCL_Month_Release_Package/blis/frame/compat/bla_omatcopy.c (line 536):
libblis: Invalid function parameter in bli_doMatCopy_ct() .

Upon downloading and compiling BLIS commit 3aa0044, I get the same behavior. In bli_doMatCopy_ct, it checks the input on line 534 with:

if ( rows <= 0 || cols <= 0 || a == NULL || b == NULL || lda < rows || ldb < rows )

Since it is applying a transpose to b, it should be comparing ldb with cols, not rows. This in the routine bli_doMatCopy_ct. There is the same issue with bli_soMatCopy_ct, bli_coMatCopy_ct, and bli_zoMatCopy_ct.

I think I also encountered this problem on AOCL-BLAS 4.2.
Perhaps issues has been disabled by amd/blis, so posting my workaround here.

Minimal reproduction code could be

/* problem.cpp */
#include "blis.h"

int main() {
    char trans = 'T';
    double alpha = 1;
    int n = 20, lda = 20;
    int m = 10, ldb = 10;  /* m = ldb smaller than n = lda could reproduce this issue */
    double *A = (double *) malloc(sizeof(double) * m * n);
    double *B = (double *) malloc(sizeof(double) * m * n);
    domatcopy(&trans, &n, &m, &alpha, A, &lda, B, &ldb);
    free(A); free(B);
}

and simply compile by

$ g++ -o problem problem.cpp -I$HOME/aocl/4.2.0/aocc/include -L$HOME/aocl/4.2.0/aocc/lib -lblis

This is not an AMD support channel. Please only report bugs against the BLIS project that's in this repo. If you can reproduce AMD BLIS bugs with this repo, by all means report them. Otherwise, take your issues to AMD.

I would have phrased it nicer but yes, the code in question is not currently in the FLAME BLIS repo. It is part of #567 which has not been merged at this point. I'm going to keep this open in case we do merge that PR.

@markbmuller, @ajz34 - you can post the issue at https://github.com/amd/blis .
Thanks for reporting, will look into this issue.

Issues Tab is currently disabled in amd/blis. Regarding the issues related to AMD BLIS Repo, please write to toolchainsupport@amd.com. Thanks.

Thanks for suggestions! I've tried managed writing to toolchainsupport@amd.com.

Some chats follows.
Actually, I searched this problem on search engines, and found this is (probably) the only related thread discussing this issue.
Just moments ago I also tried to put this issue on AMD community, but found that posting some source code (or resubmitting draft within 10 minutes) could be difficult task. So finally chose to email.

I am also hit by this problem. Issue tracker of https://github.com/amd/blis is empty. What is the current state of the bug?

We fixed this issue, and it will be available in our next release.
Thanks,
Kiran V

We fixed this issue, and it will be available in our next release.

Is there a branch at GitHub where we can fetch the fix?