Skip to content

Commit 1c5d6c5

Browse files
committed
disable xsmm with float16
1 parent c9ba51e commit 1c5d6c5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

paddle/fluid/operators/math/blas_impl.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ struct CBlas<platform::float16> {
162162
}
163163
#endif
164164
};
165+
165166
template <typename T>
166-
inline static bool UseXSMM(const int &m, const int &n, const int &k,
167-
bool transa, bool transb, const T &alpha,
168-
const T &beta) {
167+
inline bool UseXSMM(const int &m, const int &n, const int &k, bool transa,
168+
bool transb, const T &alpha, const T &beta) {
169169
#ifdef PADDLE_WITH_LIBXSMM
170170
// Refer to https://github.com/hfp/libxsmm/blob/master/README.md
171171
// But the threshold is custom
@@ -182,6 +182,14 @@ inline static bool UseXSMM(const int &m, const int &n, const int &k,
182182
return false;
183183
}
184184

185+
template <>
186+
inline bool UseXSMM<platform::float16>(const int &m, const int &n, const int &k,
187+
bool transa, bool transb,
188+
const platform::float16 &alpha,
189+
const platform::float16 &beta) {
190+
return false;
191+
}
192+
185193
template <>
186194
template <typename T>
187195
void Blas<platform::CPUDeviceContext>::GEMM(CBLAS_TRANSPOSE transA,
@@ -194,7 +202,6 @@ void Blas<platform::CPUDeviceContext>::GEMM(CBLAS_TRANSPOSE transA,
194202
#ifdef PADDLE_WITH_LIBXSMM
195203
if (UseXSMM(M, N, K, transA != CblasNoTrans, transB != CblasNoTrans, alpha,
196204
beta)) {
197-
// refer to https://github.com/hfp/libxsmm/blob/master/README.md
198205
// Note: SMM use ColMajor
199206
const char transa = 'N';
200207
const char transb = 'N';

0 commit comments

Comments
 (0)