Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions vllm_hpu_extension/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ def enabled_flags():
& Kernel(fsdpa)
& EnvFlag("VLLM_PROMPT_USE_FUSEDSDPA",
Not(ModelType('mllama')))),
"triangular_mask": (Not(Hardware("cpu"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix conflict

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalkuligowski converting to draft - there were issues with triangular and I will only merge it once I confirm its stable.

& Kernel(fsdpa)
& VersionRange(">=1.22.0.294")
& EnvFlag("VLLM_PROMPT_USE_FUSEDSDPA",
Not(ModelType('mllama')))),
"compile_one_hot": (VersionRange(">=1.20.0.370") & Not(EnvFlag("PT_HPU_LAZY_MODE", "1"))),
"flex_attention": (Not(Hardware("cpu")) & Not(EnvFlag("PT_HPU_LAZY_MODE", "1"))
& ModelType("llama")
Expand Down
6 changes: 3 additions & 3 deletions vllm_hpu_extension/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ def _fsdpa_prompt_attention(
assert attn_bias is not None or valid_seq_lengths is not None, \
'Either attn_bias or valid_seq_lengths must be != None'
if is_causal and attn_bias is not None:
# TODO: causal + attn_bias is not yet supported
is_causal = False
valid_seq_lengths = None
if 'triangular_mask' not in enabled_flags():
is_causal = False
valid_seq_lengths = torch.sum(valid_seq_lengths)
attn_weights = fsdpa_op(query, key, value, attn_bias, 0.0, is_causal,
scale, softmax_mode, recompute_mode,
valid_seq_lengths, 'right')
Expand Down