Skip to content

Commit

Permalink
DMMHA: add unit tests; fix CPU, CUDA kernel (microsoft#22567)
Browse files Browse the repository at this point in the history
### Description

Fixes:
(1) cpu kernel: applying scale before bias and mask like other MHA ops
(2) cpu kernel: correct offset during appending past to present.
(3) cuda kernel: apply mask if provided; fix output_qk offset.

Add DMMHA unit tests
  • Loading branch information
mindest authored and ankitm3k committed Dec 11, 2024
1 parent 15344f1 commit 862a94c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ static void TestDecoderMaskedMultiHeadAttention(bool is_cross_attn = true, bool

OpTester tester("DecoderMaskedMultiHeadAttention", 1, onnxruntime::kMSDomain);
FixedPatternValueGenerator generator{};
RandomValueGenerator random{123};
RandomValueGenerator random{};

// Attributes
tester.AddAttribute<int64_t>("num_heads", static_cast<int64_t>(num_heads));
Expand Down

0 comments on commit 862a94c

Please sign in to comment.