-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FastGelu float16 #621
FastGelu float16 #621
Conversation
#include "onnxruntime_c_api.h" | ||
#if ORT_API_VERSION >= 16 | ||
|
||
#include "onnxruntime_float16.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this file shipping with ort C++ package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is, since 1.16.
const T* bias_data = bias.has_value() ? (*bias)->Data() : nullptr; | ||
auto bias_length = bias.has_value() ? (*bias)->NumberOfElement() : 0; | ||
using TT = typename CudaT<T>::MappedType; | ||
LaunchFastGeluKernel<TT>(reinterpret_cast<cudaStream_t>(ctx.cuda_stream), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the return error code be handled here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point - will report it in coming iteration.
] | ||
|
||
input0 = helper.make_tensor_value_info( | ||
'x', onnx_proto.TensorProto.FLOAT16, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dumb question, which fp16 was tested here, MFloat16 or BFloat16?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is MFloat16.
For BFloat16, we need to test it by native cases since the type is not exposed via python.
Add float16 support for contrib cuda ops.