onnxruntime
fb11c673 - Fix SkipLayerNorm for 2D input (#17014)

Commit
2 years ago
Fix SkipLayerNorm for 2D input (#17014) Fix an obvious bug: (1) In packing mode, the input for SLN has two dimensions (introduced by #15283): [token_count, hidden_size]. Current code of `element_count = input_dims[0] * sequence_length * hidden_size` will use element_size = token_count * hidden_size * hidden_size, and causes invalid memory write in cuda kernel and ORT crash and two minor issues: (2) potential integer overflow in `static_cast<int>(element_count)` (3) some dead code after `return LaunchSkipLayerNormKernel` that will never have chance to run.
Author
Parents
Loading