Unverified Commit 29a637bc authored by Aarni Koskela's avatar Aarni Koskela Committed by GitHub
Browse files

Don't crash Python interpreter via assert(false) (#998)

parent 706ec24d
...@@ -1944,7 +1944,10 @@ def igemmlt(A, B, SA, SB, out=None, Sout=None, dtype=torch.int32): ...@@ -1944,7 +1944,10 @@ def igemmlt(A, B, SA, SB, out=None, Sout=None, dtype=torch.int32):
ptr, m, n, k, ptrA, ptrB, ptrC, ptrRowScale, lda, ldb, ldc ptr, m, n, k, ptrA, ptrB, ptrC, ptrRowScale, lda, ldb, ldc
) )
if has_error == 1: if has_error == 100: # `ERR_NOT_IMPLEMENTED` is defined as 100 in `ops.cu`
raise NotImplementedError("igemmlt not available (probably built with NO_CUBLASLT)")
if has_error:
print(f'A: {shapeA}, B: {shapeB}, C: {Sout[0]}; (lda, ldb, ldc): {(lda, ldb, ldc)}; (m, n, k): {(m, n, k)}') print(f'A: {shapeA}, B: {shapeB}, C: {Sout[0]}; (lda, ldb, ldc): {(lda, ldb, ldc)}; (m, n, k): {(m, n, k)}')
raise Exception('cublasLt ran into an error!') raise Exception('cublasLt ran into an error!')
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <cassert> #include <cassert>
#include <common.h> #include <common.h>
#define ERR_NOT_IMPLEMENTED 100
using namespace BinSearch; using namespace BinSearch;
using std::cout; using std::cout;
...@@ -421,14 +423,7 @@ template void transform<int32_t, COL32, ROW, false, 32>(cublasLtHandle_t ltHandl ...@@ -421,14 +423,7 @@ template void transform<int32_t, COL32, ROW, false, 32>(cublasLtHandle_t ltHandl
template <int FORMATB, int DTYPE_OUT, int SCALE_ROWS> int igemmlt(cublasLtHandle_t ltHandle, int m, int n, int k, const int8_t *A, const int8_t *B, void *C, float *row_scale, int lda, int ldb, int ldc) template <int FORMATB, int DTYPE_OUT, int SCALE_ROWS> int igemmlt(cublasLtHandle_t ltHandle, int m, int n, int k, const int8_t *A, const int8_t *B, void *C, float *row_scale, int lda, int ldb, int ldc)
{ {
#ifdef NO_CUBLASLT #ifdef NO_CUBLASLT
cout << "" << endl; return ERR_NOT_IMPLEMENTED;
cout << "=============================================" << endl;
cout << "ERROR: Your GPU does not support Int8 Matmul!" << endl;
cout << "=============================================" << endl;
cout << "" << endl;
assert(false);
return 0;
#else #else
int has_error = 0; int has_error = 0;
cublasLtMatmulDesc_t matmulDesc = NULL; cublasLtMatmulDesc_t matmulDesc = NULL;
...@@ -484,7 +479,7 @@ template <int FORMATB, int DTYPE_OUT, int SCALE_ROWS> int igemmlt(cublasLtHandle ...@@ -484,7 +479,7 @@ template <int FORMATB, int DTYPE_OUT, int SCALE_ROWS> int igemmlt(cublasLtHandle
printf("error detected"); printf("error detected");
return has_error; return has_error;
#endif #endif // NO_CUBLASLT
} }
int fill_up_to_nearest_multiple(int value, int multiple) int fill_up_to_nearest_multiple(int value, int multiple)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment