Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Ensure when USE_BLAS=mkl at mxnet build doesn't break with MKL_USE_ILP64=ON #18954

Description

@access2rohit

Description

MKL supports int64 indexing if MXNet is build with flag MKL_USE_ILP64=ON but internally mkl uses long long for 64-bit int instead of int64_t. This is fine as long as parameters are passed by value but when they are passed as reference *int64_t is treated as *long hence for 64-bit integer pointers there is a type mismatch by compiler while building MXNet which is cannot convert 'long int *' to 'long long int*' as shown in colsole snippet shown below

../src/api/operator/numpy/linalg/../../../../operator/numpy/linalg/../../tensor/.././c_lapa
ck_api.h: In function 'int MXNET_LAPACK_dgetri(int, int, double*, int, int*, double*, int)'
:                                                                                          
../src/api/operator/numpy/linalg/../../../../operator/numpy/linalg/../../tensor/.././c_lapa
ck_api.h:382:68: error: cannot convert 'long int*' to 'long long int*' for argument '5' to
 'long long int LAPACKE_dgetri(int, long long int, double*, long long int, const long long 
int*)'                                                                                     
       return LAPACKE_##prefix##getri(matrix_layout, n, a, lda, ipiv); \                   
                                                                    ^                      
../src/api/operator/numpy/linalg/../../../../operator/numpy/linalg/../../tensor/.././c_lapa
ck_api.h:388:3: note: in expansion of macro 'MXNET_LAPACK_CWRAP_GETRI'                     
   MXNET_LAPACK_CWRAP_GETRI(d, double)                                                     
   ^~~~~~~~~~~~~~~~~~~~~~~~  

In order to fix it LAPACK and BLAS declarations and calls to MKL need to casted(reinterpret_cast<long long int*>) inside MXNet code base.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions