Skip to content
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

RotaryEmbedding Contrib OP #3695

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
15 changes: 15 additions & 0 deletions src/targets/gpu/lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ struct miopen_apply
add_convolution_backwards_op();
add_select_module_op();
add_reshape_lazy_op();
add_rotary_embedding_op();
add_group_query_attention_op();
add_scan_slice_op();
}
Expand Down Expand Up @@ -521,6 +522,20 @@ struct miopen_apply
});
}

void add_rotary_embedding_op()
{
apply_map.emplace("gpu::gqa_rotary_embedding", [=](instruction_ref ins) {
auto s = ins->get_shape();
auto output = insert_allocation(ins, s);
auto new_inputs = ins->inputs();
new_inputs.push_back(output);
return mod->replace_instruction(
ins,
make_op("gpu::precompile_op", {{"op", to_value(ins->get_operator())}}),
new_inputs);
});
}

void add_group_query_attention_op()
{
apply_map.emplace("gpu::gqa_rotary_embedding", [=](instruction_ref ins) {
Expand Down
Loading