d-smirnov commented on a change in pull request #8509:
URL: https://github.com/apache/tvm/pull/8509#discussion_r794065178
##########
File path: src/relay/transforms/fuse_ops.cc
##########
@@ -1017,18 +1050,30 @@ class FuseMutator : private MixedModeMutator {
}
};
-Expr FuseOps(const Expr& expr, int fuse_opt_level, size_t max_fuse_depth,
const IRModule& module) {
- return FuseMutator().Transform(expr, fuse_opt_level, max_fuse_depth);
+Expr FuseOps(const Expr& expr, int fuse_opt_level, size_t max_fuse_depth, bool
link_params,
+ const IRModule& module) {
+ return FuseMutator()
+ .SetFuseOptLevel(fuse_opt_level)
+ ->SetMaxFuseDepth(max_fuse_depth)
+ ->SetLinkParams(link_params)
+ ->Transform(expr);
}
namespace transform {
Pass FuseOps(int fuse_opt_level) {
runtime::TypedPackedFunc<Function(Function, IRModule, PassContext)>
pass_func =
[=](Function f, IRModule m, PassContext pc) {
+ bool link_params = false;
+ Executor executor =
+
m->GetAttr<Executor>(tvm::attr::kExecutor).value_or(NullValue<Executor>());
+ link_params = executor.defined()
+ ?
executor->attrs.GetAttr<Bool>("link-params").value_or(Bool(link_params))
+ : link_params;
+ link_params = pc->GetConfig("relay.FuseOps.link_params",
Bool(link_params)).value();
Review comment:
There is more precise control for fuse_ops via
`relay.FuseOps.link_params` which is in use
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]