-
Notifications
You must be signed in to change notification settings - Fork 87
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
reorder_slice_add_mul matcher #3478
base: develop
Are you sure you want to change the base?
reorder_slice_add_mul matcher #3478
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3478 +/- ##
=========================================
Coverage 92.16% 92.17%
=========================================
Files 512 513 +1
Lines 21403 21684 +281
=========================================
+ Hits 19726 19987 +261
- Misses 1677 1697 +20 ☔ View full report in Codecov by Sentry. |
…e-horizontal-fusion-opportunities
381540b
to
69457bd
Compare
Unit tests needs to be added. |
This reverts commit 69457bd.
…ify_algebra-to-find-more-horizontal-fusion-opportunities
…e-horizontal-fusion-opportunities
test/simplify_algebra_test.cpp
Outdated
migraphx::shape s1{migraphx::shape::int8_type, {1, 768, 768}}; | ||
migraphx::shape s2{migraphx::shape::int8_type, {1, 77, 768}}; | ||
|
||
std::vector<std::pair<migraphx::shape, int>> literals_info = { |
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.
Remove this.
test/simplify_algebra_test.cpp
Outdated
literals.reserve(literals_info.size()); | ||
for(const auto& literal_info : literals_info) | ||
{ | ||
literals.push_back(m1.add_literal( |
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.
Move the literal generation to the loop below.
test/simplify_algebra_test.cpp
Outdated
migraphx::shape s1{migraphx::shape::int8_type, {1, 768, 768}}; | ||
migraphx::shape s2{migraphx::shape::int8_type, {1, 77, 768}}; | ||
|
||
std::vector<std::pair<migraphx::shape, int>> literals_info = { |
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.
Remove this as well, just generate the literal directly.
auto dot_i = m1.add_instruction(migraphx::make_op("dot"), a, literals[i * 2]); | ||
auto add_i = m1.add_instruction(migraphx::make_op("add"), dot_i, literals[i * 2 + 1]); | ||
add_results.push_back(add_i); | ||
} |
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.
Literals should be generated in the loop:
for(int i = 0; i < 3; ++i)
{
auto lit1 = m1.add_literal(migraphx::generate_literal(s1, i));
auto lit2 = m1.add_literal(migraphx::generate_literal(s2, i));
auto dot_i = m1.add_instruction(migraphx::make_op("dot"), a, lit1);
auto add_i = m1.add_instruction(migraphx::make_op("add"), dot_i, lit2);
add_results.push_back(add_i);
}
auto add_final = | ||
m1.add_instruction(migraphx::make_op("add"), dot_i, literals[4 + i * 2]); | ||
final_add_results.push_back(add_final); | ||
} |
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.
Generate literals in the loop:
for(int i = 0; i < 3; ++i)
{
auto lit1 = m1.add_literal(migraphx::generate_literal(s2, i));
auto lit2 = m1.add_literal(migraphx::generate_literal(s1, i));
auto lit3 = m1.add_literal(migraphx::generate_literal(s2, i + 3));
auto add_i = m1.add_instruction(migraphx::make_op("add"), a, lit1);
auto dot_i = m1.add_instruction(migraphx::make_op("dot"), add_i, lit2);
auto add_final =
m1.add_instruction(migraphx::make_op("add"), dot_i, lit3);
final_add_results.push_back(add_final);
}
This build is not recommended to merge 🔴 |
🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output |
No description provided.