Skip to content

Commit

Permalink
[CUBLAS] Remove deprecated CUBLAS_TENSOR_OP_MATH flag (apache#8130)
Browse files Browse the repository at this point in the history
This flag is causes CUBLAS to use tensore cores on all operations. With
f32 or f64 operations, this leads to loss of accuracy.
  • Loading branch information
tkonolige authored and trevor-m committed Jun 17, 2021
1 parent 2210c81 commit f20de7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/contrib/cublas/cublas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ inline void CUBLASTryEnableTensorCore(cublasHandle_t hdl) {
// TensorCores are only supported in cublas 9.0 or higher
int version;
CHECK_CUBLAS_ERROR(cublasGetVersion(hdl, &version));
if (version >= 9000) CHECK_CUBLAS_ERROR(cublasSetMathMode(hdl, CUBLAS_TENSOR_OP_MATH));
if (version >= 9000) CHECK_CUBLAS_ERROR(cublasSetMathMode(hdl, CUBLAS_DEFAULT_MATH));
}

struct CublasHgemmOp {
Expand Down

0 comments on commit f20de7d

Please sign in to comment.