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:
parent
92829376a1
commit
3d0d45b409
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue