Mask Types
The mask types are not independent features. The mask of the paged attention operator is complex. For ease of understanding, the mask types are described separately.
maskType |
Hardware Type |
Dimension |
Remarks |
|---|---|---|---|
UNDEFINED |
No mask |
No mask |
All-zero mask |
MASK_TYPE_NORM |
[batch, 1, max_seq_len], [1, max_seq_len], or [max_seq_len, max_seq_len] |
Inverted triangle mask |
|
[batch, max_seq_len / 16, 16, 16] or [1, max_seq_len / 16, 16, 16] |
|||
MASK_TYPE_ALIBI |
[batch, num_head, 1, max_seq_len] or [num_head, 1, max_seq_len] |
alibi mask |
|
[batch * num_head, max_seq_len / 16, 16, 16] or [num_head, max_seq_len / 16, 16, 16] |
|||
MASK_TYPE_SPEC |
[num_tokens, max_seq_len] |
Parallel decoding mask |
|
[1, max_seq_len / 16, num_tokens, 16] |
|||
MASK_TYPE_MASK_FREE |
[1, 8, 128, 16] |
Fixed inverted triangle mask of 128 × 128. |
For the