CUTLASS 2.7 (#318)
CUTLASS 2.7 Mainloop fusion for GEMM: summation over A or B Strided DGRAD (optimized iterators) Half-precision GELU_taylor activation functions Use these when accumulation and epilogue compute types are all cutlass::half_t Tuning and bug fixes to fused GEMM + GEMM example Support for smaller than 128b aligned Convolutions: see examples Caching of results to accelerate Convolution unit tests Can be enabled or disabled by running cmake .. -DCUTLASS_TEST_ENABLE_CACHED_RESULTS=OFF Corrections and bug fixes reported by the CUTLASS community Thank you for filing these issues! authored-by: Haicheng Wu haichengw@nvidia.com, Manish Gupta manigupta@nvidia.com, Dustyn Blasig dblasig@nvidia.com, Andrew Kerr akerr@nvidia.com
This commit is contained in:
@@ -159,3 +159,41 @@ TEST(Epilogue_thread_linear_combination_gelu, device_side_f16_f16_ptr) {
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TEST(Epilogue_thread_linear_combination_gelu_taylor, device_side_f16_f16_ptr) {
|
||||
|
||||
using Element = cutlass::half_t;
|
||||
using ElementOutput = cutlass::half_t;
|
||||
int const kCount = 8;
|
||||
|
||||
using LinearCombinationGELU = cutlass::epilogue::thread::LinearCombinationGELU<
|
||||
ElementOutput,
|
||||
kCount,
|
||||
Element,
|
||||
Element>;
|
||||
|
||||
Element alpha = Element(1);
|
||||
Element beta = Element(0);
|
||||
|
||||
typename LinearCombinationGELU::Params params(&alpha, &beta);
|
||||
|
||||
LinearCombinationGELU linear_combination_op(params);
|
||||
|
||||
cutlass::Array<Element, kCount> accum;
|
||||
|
||||
for (int i = 0; i < kCount; ++i) {
|
||||
accum[i] = Element((float)i * 0.3f);
|
||||
}
|
||||
|
||||
cutlass::Array<ElementOutput, kCount> destination = linear_combination_op(accum, accum);
|
||||
cutlass::epilogue::thread::GELU<ElementOutput> gelu_func;
|
||||
|
||||
for (int i = 0; i < kCount; ++i) {
|
||||
ElementOutput expected = gelu_func(accum[i]);
|
||||
ElementOutput got = destination[i];
|
||||
EXPECT_TRUE(expected == got);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user