mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-09 17:28:58 +00:00
Misc minor bug fixes in transformer kernels (#13780)
This commit is contained in:
parent
f34ebbc8ff
commit
5f4e0c95ec
2 changed files with 3 additions and 3 deletions
|
|
@ -191,7 +191,7 @@ Status BeamSearchBase<T>::CheckInputs(const OpKernelContextInternal& context) {
|
|||
context.Input<Tensor>(0), // input_ids
|
||||
context.Input<Tensor>(7), // vocab_mask
|
||||
context.Input<Tensor>(8), // prefix_vocab_mask
|
||||
context.Input<Tensor>(10))); // attention_mask
|
||||
context.Input<Tensor>(9))); // attention_mask
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,14 +122,14 @@ Status Attention<T>::ComputeInternal(OpKernelContext* context) const {
|
|||
cublasHandle_t cublas = CublasHandle();
|
||||
constexpr size_t element_size = sizeof(T);
|
||||
|
||||
IAllocatorUniquePtr<T> gemm_buffer;
|
||||
IAllocatorUniquePtr<void> gemm_buffer;
|
||||
if (weights != nullptr) {
|
||||
// Use GEMM for fully connection.
|
||||
int m = batch_size * sequence_length;
|
||||
int n = (parameters.hidden_size + parameters.hidden_size + parameters.v_hidden_size);
|
||||
int k = parameters.input_hidden_size;
|
||||
size_t gemm_buffer_size = static_cast<size_t>(batch_size) * sequence_length * n * element_size;
|
||||
gemm_buffer = GetScratchBuffer<T>(gemm_buffer_size);
|
||||
gemm_buffer = GetScratchBuffer<void>(gemm_buffer_size);
|
||||
|
||||
typedef typename ToCudaType<T>::MappedType CudaT;
|
||||
CudaT one = ToCudaType<T>::FromFloat(1.0f);
|
||||
|
|
|
|||
Loading…
Reference in a new issue