Fix AMD pipeline test failures (#19250)

### Description
<!-- Describe your changes. -->

Fix amd test failure

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
This commit is contained in:
Ye Wang 2024-01-24 03:33:49 +00:00 committed by GitHub
parent cbb29d80ff
commit 6a424ccf8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -68,6 +68,7 @@ MultiHeadAttention<T>::MultiHeadAttention(const OpKernelInfo& info)
scale_ = info.GetAttrOrDefault<float>("scale", 0.0f);
past_present_share_buffer_ = info.GetAttrOrDefault<int64_t>("past_present_share_buffer", 0LL) != 0LL;
is_unidirectional_ = info.GetAttrOrDefault<int64_t>("unidirectional", 0) == 1;
using HipT = typename ToHipType<T>::MappedType;
using AttentionTunableOp = GemmSoftmaxGemmPermuteTunableOp<HipT>;
@ -121,8 +122,8 @@ Status MultiHeadAttention<T>::ComputeInternal(OpKernelContext* context) const {
query, key, value, bias,
key_padding_mask, relative_position_bias,
past_key, past_value, past_seq_len,
&attn,
num_heads_, mask_filter_value_, scale_,
&attn, num_heads_,
mask_filter_value_, scale_, false, /*is_unidirectional_*/
past_present_share_buffer_, false, device_prop.maxThreadsPerBlock));
if (attn_type_ == kDecoderMaskedMultiHeadAttention && attn.sequence_length != 1) {

View file

@ -25,6 +25,7 @@ class MultiHeadAttention final : public RocmKernel {
float mask_filter_value_;
float scale_;
bool past_present_share_buffer_{false};
bool is_unidirectional_{false};
// type-erased GemmSoftmaxGemmPermuteTunableOp<HipT>, the reason for this is:
// 1. We don't want to include the cuh file where GemmSoftmaxGemmPermuteTunableOp<HipT> is defined.