Skip to content

Commit

Permalink
RoPE fusings print
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyamin-Roman committed Jul 1, 2024
1 parent 5480d41 commit 40fc92c
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ov::pass::RoPEFusionGPTNEOX::RoPEFusionGPTNEOX() {
if (!validator) {
return false;
}
std::cout << "RoPEFusionGPTNEOX" << std::endl;

const auto& pattern_map = m.get_pattern_value_map();
auto root = m.get_match_root();
Expand Down Expand Up @@ -155,6 +156,7 @@ ov::pass::RoPEFusionCosSinPreprocess::RoPEFusionCosSinPreprocess() {
if (!validator) {
return false;
}
std::cout << "RoPEFusionCosSinPreprocess" << std::endl;
const auto& pattern_map = m.get_pattern_value_map();
auto root = m.get_match_root();
auto rope_node = as_type_ptr<op::internal::RoPE>(pattern_map.at(rope).get_node_shared_ptr());
Expand Down Expand Up @@ -215,6 +217,7 @@ ov::pass::RoPEFusionIOSlicing::RoPEFusionIOSlicing() {
if (!validator) {
return false;
}
std::cout << "RoPEFusionIOSlicing" << std::endl;
auto ndims = validator["ndims"];

const auto& config = rope_node->get_config();
Expand Down Expand Up @@ -257,6 +260,7 @@ ov::pass::RoPEFusionPreprocess::RoPEFusionPreprocess() {
if (!validator) {
return false;
}
std::cout << "RoPEFusionPreprocess" << std::endl;

const auto& pattern_map = m.get_pattern_value_map();
auto root = m.get_match_root();
Expand Down Expand Up @@ -364,6 +368,7 @@ ov::pass::RoPEFusionGPTJ::RoPEFusionGPTJ() {
if (!validator) {
return false;
}
std::cout << "RoPEFusionGPTJ" << std::endl;

op::internal::RoPE::Config config;
OutputVector new_args;
Expand Down Expand Up @@ -498,6 +503,7 @@ ov::pass::RoPEFusionChatGLM::RoPEFusionChatGLM(int split_output_id) {
if (!validator) {
return false;
}
std::cout << "RoPEFusionChatGLM" << std::endl;

op::internal::RoPE::Config config;
OutputVector new_args;
Expand Down Expand Up @@ -623,6 +629,8 @@ ov::pass::RoPEFusionQwen::RoPEFusionQwen(int split_output_id) {
return false;
}

std::cout << "RoPEFusionQwen" << std::endl;

op::internal::RoPE::Config config;
OutputVector new_args;
config.is_qwen = true;
Expand Down Expand Up @@ -765,6 +773,7 @@ ov::pass::RoPEShareCosSin::RoPEShareCosSin() {
m_shared_cos0 = root;
return false;
}
std::cout << "RoPEShareCosSin" << std::endl;

// all inputs & consts are same, we can safely shared the subgraph
// Just for record, the pattern uses cos | sin as root node. This means that we could match both cases.
Expand Down

0 comments on commit 40fc92c

Please sign in to comment.