onnxruntime/onnxruntime
Tianlei Wu d79e3c5791
Extend Attention Bias Broadcast Support (#21710)
### Description
Previously, MultiHeadAttention supports relative position bias of shape
[1, N, S, T] or [B, N, S, T], and DecoderMaskedMultiHeadAttention
supports [1, N, S, T]. This will extend the support to allow [1, N, S,
T], [B, N, S, T], [B, 1, S, T] and [1, 1, S, T] for CUDA and CPU EPs.

- [x] Rename the input of "relative position bias" to "attention bias"
because it can also be used for other types of bias, like ALiBi
(Attention with Linear Biases) or attention mask.
- [x] Update unfused kernel to support broadcasting 2nd dimension of
attention bias.
- [x] Update efficient attention to support broadcasting 2nd dimension
of attention bias.
- [x] Update operators (MultiHeadAttention,
DecoderMaskedMultiHeadAttention, Attention, PackedAttention,
PackedMultiHeadAttention) to support broadcast attention bias on CUDA
and CPU EPs.
- [x] Update ROCm, DML and WebGPU naming to be consistent. (Note that
those EPs do not support broadcasting attention_bias for now).
- [x] Add attention bias tests for MultiHeadAttention.
- [x] Update operator documents
- [x] Update benchmark script

Other changes:
* Fix some checks in multihead-attention.ts
* Add helper functions to dump tensors given dimensions.
2024-08-16 15:40:04 -07:00
..
contrib_ops Extend Attention Bias Broadcast Support (#21710) 2024-08-16 15:40:04 -07:00
core Extend Attention Bias Broadcast Support (#21710) 2024-08-16 15:40:04 -07:00
python Extend Attention Bias Broadcast Support (#21710) 2024-08-16 15:40:04 -07:00
test Extend Attention Bias Broadcast Support (#21710) 2024-08-16 15:40:04 -07:00
tool/etw Fix typos - 1st Wave (#21278) 2024-07-11 13:35:08 +08:00
wasm [js/web] allow relative path matching (#21657) 2024-08-09 03:13:40 -07:00
__init__.py bumps up version in main from 1.19 -> 1.20 (#21588) 2024-08-05 15:46:04 -07:00
ReformatSource.ps1
ReformatSourcePython.bat
VSCodeCoverage.runsettings