-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【CINN】Add DSL test case for rope of llama #61130
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
class origin: | ||
@to_cinn_llir | ||
def fn_rotary( | ||
A: DataArray((1, -1, 1, 512)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add another test case that replaces the first 1 to 64?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should replace it with a symbol indeed, but dsl don't support it, so temporarily we use a constant shape 1, maybe this can be a TODO
var_2: DataArray((1, -1, 1, 256)), | ||
var_3: DataArray((1, -1, 1, 512)), | ||
C: DataArray((1, -1, 1, 512)), | ||
index: DataArray((2, 1), dtype=common.Int(32)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this type be Int(64), since we will use int64 for shape now? So I guess the index value should be Int(64)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -165,8 +165,124 @@ def elementwise_add_inline_gt( | |||
assert_llir_equal(elementwise_add_inline, elementwise_add_inline_gt) | |||
|
|||
|
|||
def test_llama_rope_compute_inline(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not complete rope, maybe write "xxx_xxx_pattern"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* add slice * rename test case and use int64 to indexing
PR types
Others
PR changes
Others
Description
pcard-72718
This pr add DSL test case for rope of llama
Here we construct a gather + slice + concat + multiply to simulate calculation logic of rope in llama