Byshiue patch 2 (#805)

* fix: fix the problem that we do not destroy the cublaslt Desc and lead to memory leak
This commit is contained in:
byshiue 2021-01-08 14:18:26 +08:00 committed by GitHub
parent 92829376a1
commit 3d0d45b409
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -193,6 +193,11 @@ void cublasLtMM_withAlgo(int *res, int batchCount, int m, int n, int k,
res,
CtransformDesc,
(findAlgo == 1 ? (&algo) : NULL), NULL, 0, stream);
cublasLtMatmulDescDestroy(matmulDesc);
cublasLtMatrixLayoutDestroy(AtransformDesc);
cublasLtMatrixLayoutDestroy(BtransformDesc);
cublasLtMatrixLayoutDestroy(CtransformDesc);
}
//for int8 IO cublasLtMM with algo
@ -281,6 +286,11 @@ void cublasLtMM_withAlgo_int8IO(int8_t *res, int batchCount, int m, int n, int k
res,
CtransformDesc,
(findAlgo == 1 ? (&algo) : NULL), NULL, 0, stream);
cublasLtMatmulDescDestroy(matmulDesc);
cublasLtMatrixLayoutDestroy(AtransformDesc);
cublasLtMatrixLayoutDestroy(BtransformDesc);
cublasLtMatrixLayoutDestroy(CtransformDesc);
}
template <typename T>

View file

@ -243,6 +243,11 @@ void cublasLtMM_withAlgo(int *res, int batchCount, int m, int n, int k,
res,
CtransformDesc,
(findAlgo == 1 ? (&algo) : NULL), NULL, 0, stream);
cublasLtMatmulDescDestroy(matmulDesc);
cublasLtMatrixLayoutDestroy(AtransformDesc);
cublasLtMatrixLayoutDestroy(BtransformDesc);
cublasLtMatrixLayoutDestroy(CtransformDesc);
}
//for int8 IO cublasLtMM with algo
@ -384,6 +389,11 @@ void cublasLtMM_withAlgo_int8IO(int8_t *res, int batchCount, int m, int n, int k
res,
CtransformDesc,
(findAlgo == 1 ? (&algo) : NULL), NULL, 0, stream);
cublasLtMatmulDescDestroy(matmulDesc);
cublasLtMatrixLayoutDestroy(AtransformDesc);
cublasLtMatrixLayoutDestroy(BtransformDesc);
cublasLtMatrixLayoutDestroy(CtransformDesc);
}
template <typename T>