srkreddy1238 commented on code in PR #17599:
URL: https://github.com/apache/tvm/pull/17599#discussion_r1929677684


##########
src/script/printer/relax/utils.h:
##########
@@ -141,7 +141,7 @@ inline int FindVDeviceIndexByTargetKind(const VDevice& 
vdevice, const IRDocsifie
   int kind_index = 0;
   for (size_t i = 0; i < vdevices.size(); ++i) {
     auto vdev = Downcast<VDevice>(vdevices[i]);
-    if (vdev.same_as(vdevice)) {
+    if (vdev == vdevice) {

Review Comment:
   Should be possible (I think RealizeVDevice pass does similar). Let me 
explore...



##########
python/tvm/relax/transform/transform.py:
##########
@@ -1092,6 +1095,10 @@ def LegalizeOps(
         legalization function is not registered. By default we don't print
         warnings.
 
+    add_attributes : bool

Review Comment:
   After legalization pass we don't have any trace of operator specific 
attributes.



##########
src/relax/op/tensor/binary.cc:
##########
@@ -157,15 +157,21 @@ InferLayoutOutput InferLayoutBinaryEwise(const Call& call,
 
   Optional<ShapeExpr> shape1 = 
GetRef<ShapeExpr>(x1_sinfo->shape.as<ShapeExprNode>());
   Optional<ShapeExpr> shape2 = 
GetRef<ShapeExpr>(x2_sinfo->shape.as<ShapeExprNode>());
+
   // Lets handle sub indexing as long as primal dims are matching
-  if (layout1->layout.ndim_primal() == layout2->layout.ndim_primal()) {
-    if ((layout1->layout.ndim() >= layout2->layout.ndim()) && 
shape2.defined()) {
-      if (CanProveLayoutTransform(layout2->layout, layout1->layout, 
shape2.value()->values)) {
-        return InferLayoutOutput({layout1, layout1}, {layout1}, 
Attrs(call->attrs));
-      }
-    } else if (shape1.defined()) {
-      if (CanProveLayoutTransform(layout1->layout, layout2->layout, 
shape1.value()->values)) {
-        return InferLayoutOutput({layout2, layout2}, {layout2}, 
Attrs(call->attrs));
+  if ((layout1->layout.ndim() != layout1->layout.ndim_primal()) ||

Review Comment:
   This is the where we have any one input come with sub indexed layout (Ex. 
one being NCHW & other being NCHW4c). All we are trying is to prove the NCHW 
input be transformed to NCHW4c. If yes, we let both inputs in NCHW4c or choose 
NCHW. Let me add couple of tests here.



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