-
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
Added support for standalone dot operations with mlir #2169
Conversation
484e25e
to
2f133bc
Compare
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.
There would be module name collisions. I have suggested one way to fix it.
2f133bc
to
d1a8f7a
Compare
Codecov Report
@@ Coverage Diff @@
## develop #2169 +/- ##
========================================
Coverage 91.48% 91.48%
========================================
Files 426 426
Lines 15927 15927
========================================
Hits 14571 14571
Misses 1356 1356 |
Resolved |
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!
This build is OK for merge ✅ |
🔴torchvision-inceptionv3_1: FAILED: MIGraphX is not within tolerance - check verbose output🔴cadene-dpn92_1: FAILED: MIGraphX is not within tolerance - check verbose output🔴slim-inceptionv4_1: FAILED: MIGraphX is not within tolerance - check verbose output |
return false; | ||
} | ||
return is_requested("dot"); | ||
} |
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.
Just make a is_standalone_op_enabled
that takes the op name as a parameter.
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.
@pfultz2. Maybe, instead of is_standalone_op_enabled
, we can generalize it for all ops and call it, for example, is_op_enabled
?
What do you think about the following code?
bool is_op_enabled(std::string_view op_name, context* ctx)
{
if(is_self_decide())
{
if(op_name == "fused")
{
return true;
}
else if(op_name == "convolution")
{
if(ctx == nullptr)
{
return false;
}
else
{
const auto& device = ctx->get_current_device();
const std::string navi_family{"gfx110"};
return starts_with(device.get_gfx_name(), navi_family);
}
}
else
{
return false;
}
}
return is_requested(op_name);
}
} // namespace
#endif // MIGRAPHX_MLIR
void fuse_mlir::apply(module_pass_manager& mpm) const
{
#ifdef MIGRAPHX_MLIR
if(is_op_enabled("fused", this->ctx))
{
match::find_matches(mpm, find_mlir_fused_ops{});
}
if(is_op_enabled("convolution", this->ctx))
{
match::find_matches(mpm, find_mlir_standalone_convolution_op{});
}
if(is_op_enabled("dot", this->ctx))
{
match::find_matches(mpm, find_mlir_standalone_dot_op{});
}
#else
(void)mpm;
#endif
}
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.
Yea thats a good idea.
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.
Thanks! Done.
d1a8f7a
to
d831dcd
Compare
@ravil-mobile don't merge develop in to this PR anymore, I have it in the merge pipeline and additional merges overload CI. |
Ok, I didn't realize that there was a dedicated merge pipeline |
The PR enables the code generation of standalone dot operations with MLIR.
@manupak, could you, please, have a look at this PR. If everything is ok I will ask Paul to make a review.Hi @pfultz2, could you, please, make a review of this PR? It extends PR #2142 by adding the option to generate standalone
dot
operations.