Softmax (#546)
* add test layernorm g-mem version * Delete include/configure directory * Delete examples/test_layernorm directory * Update gemm_with_softmax.h * Update gemm_softmax.cu * Update linear_combination.h * Update fast_math.h * remove redundant vars Co-authored-by: yujia.zhai <yujia.zhai@bytedance.com> Co-authored-by: yuzhai <yuzhai@nvidia.com>
This commit is contained in:
@@ -71,7 +71,7 @@ public:
|
||||
using ElementCompute = ElementCompute_;
|
||||
|
||||
static int const kCount = Count;
|
||||
|
||||
static const ScaleType::Kind kScale = Scale;
|
||||
using FragmentOutput = Array<ElementOutput, kCount>;
|
||||
using FragmentAccumulator = Array<ElementAccumulator, kCount>;
|
||||
using ComputeFragment = Array<ElementCompute, kCount>;
|
||||
|
||||
@@ -718,11 +718,11 @@ double fast_exp(double x) {
|
||||
}
|
||||
|
||||
CUTLASS_HOST_DEVICE
|
||||
float fast_exp(half_t x) {
|
||||
half_t fast_exp(half_t x) {
|
||||
#if defined(__CUDA_ARCH__) && (__CUDACC_VER_MAJOR__ >= 10) && (__CUDA_ARCH__ >= 750)
|
||||
return ::hexp(x.to_half());
|
||||
return (half_t)(::hexp(x.to_half()));
|
||||
#else
|
||||
return fast_exp(float(x));
|
||||
return (half_t)(fast_exp(float(x)));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -908,4 +908,3 @@ T absolute_value(T x) {
|
||||
} // namespace cutlass
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user