Skip to content

Commit

Permalink
fix call of GELU_Taylor in LinearCombinationGeneric (NVIDIA#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
lygztq authored Sep 21, 2022
1 parent a821280 commit 9f2e3fa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/cutlass/epilogue/thread/activation.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,11 @@ struct GELU_taylor {

using Params = LinearCombinationGenericParams<T>;

CUTLASS_HOST_DEVICE
T operator()(T const &scalar, Params const &params_) const {
return this->operator()(scalar);
}

};

template <int N>
Expand Down Expand Up @@ -603,6 +608,11 @@ struct GELU_taylor<Array<half_t, N> > {
}

using Params = LinearCombinationGenericParams<half_t>;

CUTLASS_HOST_DEVICE
Array<half_t, N> operator()(Array<half_t, N> const &rhs, Params const &params_) const {
return this->operator()(rhs);
}
};

template <typename T, int N>
Expand All @@ -622,6 +632,11 @@ struct GELU_taylor<Array<T, N> > {
}

using Params = LinearCombinationGenericParams<T>;

CUTLASS_HOST_DEVICE
Array<T, N> operator()(Array<T, N> const &rhs, Params const &params_) const {
return this->operator()(rhs);
}
};

/// Computes backwards pass for GELU operator assuming d_t is the layer gradient and
Expand Down

0 comments on commit 9f2e3fa

Please sign in to comment.