Archermmt commented on code in PR #16128:
URL: https://github.com/apache/tvm/pull/16128#discussion_r1396417597


##########
src/relax/transform/fuse_ops.cc:
##########
@@ -1102,6 +1106,13 @@ class PatternBasedPartitioner : ExprVisitor {
       auto parent_group = GetGroupForBoundVar(binding->var);
       ICHECK(parent_group);
       parent_group->attrs.Set(attr::kComposite, pat_name_);
+      if (attrs_getter_ != nullptr) {
+        const auto& custom_attrs =
+            attrs_getter_(CreatePatternCheckContext(call, 
matches_opt.value()));

Review Comment:
   And I'll update the test case when the discussion about "context" is done. 
Currently adding the attributes is mainly for TensorRT translation. An 
"id_name" should be used to mark same expression in relax and TensorRT, so that 
each "layer" in the model can share their optimization strategy. The 
optimization here mainly refers to pruning, sparse and quantization.



-- 
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]

Reply via email to