Skip to content

Commit

Permalink
[Bug] Disable cpu fp16 (dmlc#2783)
Browse files Browse the repository at this point in the history
* disable cpu fp16

* spell mistakes
  • Loading branch information
BarclayII authored Mar 25, 2021
1 parent 03482f0 commit 0b57ce1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/array/cpu/sddmm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace aten {
typedef double DType; \
{ __VA_ARGS__ } \
} else { \
LOG(FATAL) << "Data type not renogized with bits " << bits; \
LOG(FATAL) << "Data type not recognized with bits " << bits; \
} \
} while (0)

Expand Down
6 changes: 4 additions & 2 deletions src/array/cpu/spmm_binary_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,16 @@ constexpr DType Min<DType>::zero;

#define SWITCH_BITS(bits, DType, ...) \
do { \
if ((bits) == 16 || (bits) == 32) { \
if ((bits) == 16) { \
LOG(FATAL) << "FP16 not supported on CPU"; \
} else if ((bits) == 32) { \
typedef float DType; \
{ __VA_ARGS__ } \
} else if ((bits) == 64) { \
typedef double DType; \
{ __VA_ARGS__ } \
} else { \
LOG(FATAL) << "Data type not renogized with bits " << bits; \
LOG(FATAL) << "Data type not recognized with bits " << bits; \
} \
} while (0)

Expand Down
4 changes: 2 additions & 2 deletions src/array/cuda/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace cuda {
typedef double DType; \
{ __VA_ARGS__ } \
} else { \
LOG(FATAL) << "Data type not renogized with bits " << bits; \
LOG(FATAL) << "Data type not recognized with bits " << bits; \
} \
} while (0)
#else // USE_FP16
Expand All @@ -44,7 +44,7 @@ namespace cuda {
typedef double DType; \
{ __VA_ARGS__ } \
} else { \
LOG(FATAL) << "Data type not renogized with bits " << bits; \
LOG(FATAL) << "Data type not recognized with bits " << bits; \
} \
} while (0)
#endif // USE_FP16
Expand Down

0 comments on commit 0b57ce1

Please sign in to comment.