/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ops/fmha/block/block_attention_bias_enum.hpp Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ops/fmha/block/block_attention_bias_enum.hpp Source File#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ops/fmha/block/block_attention_bias_enum.hpp Source File
block_attention_bias_enum.hpp
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
2 // Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved.
3 
4 #pragma once
5 
6 #include <string>
7 
8 namespace ck_tile {
9 
10 // This class is used for codegen pattern matching
12 {
13  NO_BIAS = 0,
14  ELEMENTWISE_BIAS = 1, // attention bias, each elements add to the result of Q*K(after scale)
15  ALIBI = 2, // bias computed with position encoding, applied after scale
16 };
17 
18 template <BlockAttentionBiasEnum>
20 
21 template <>
23 {
24  static constexpr const char* name = "";
25 };
26 template <>
28 {
29  static constexpr const char* name = "bias";
30 };
31 template <>
33 {
34  static constexpr const char* name = "alibi";
35 };
36 
37 } // namespace ck_tile
Definition: cluster_descriptor.hpp:13
BlockAttentionBiasEnum
Definition: block_attention_bias_enum.hpp:12
constexpr uint32_t ALIBI
Definition: variants.hpp:232
Definition: block_attention_bias_enum.hpp:19