vinx13 commented on code in PR #14649:
URL: https://github.com/apache/tvm/pull/14649#discussion_r1169141188
##########
python/tvm/relax/backend/patterns.py:
##########
@@ -217,13 +220,23 @@ def make_stacked_attention_pattern(with_bias: bool =
False):
check function and codegen.
"""
stacked_qkv = wildcard()
- qkv_tuple = is_op("relax.split")(stacked_qkv)
+ if start_op == "split":
+ qkv_tuple = is_op("relax.split")(stacked_qkv)
+ query_raw = is_tuple_get_item(qkv_tuple, 0)
+ key_raw = is_tuple_get_item(qkv_tuple, 1)
+ value_raw = is_tuple_get_item(qkv_tuple, 2)
+ elif start_op == "strided_slice":
+ query_raw = is_op("relax.strided_slice")(stacked_qkv)
+ key_raw = is_op("relax.strided_slice")(stacked_qkv)
+ value_raw = is_op("relax.strided_slice")(stacked_qkv)
Review Comment:
we will also need to check the begin/end in strides_slice if value has a
different sequence length
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]