You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "srkreddy1238 (via GitHub)" <gi...@apache.org> on 2026/01/12 08:57:55 UTC

[PR] [RELAX][LAYOUT] Support multiple axis packing [tvm]

srkreddy1238 opened a new pull request, #18657:
URL: https://github.com/apache/tvm/pull/18657

   Like OIHW[4o4i] where we can pack multiple axis.
   Helpful while handling complex target layouts.
   This PR covers layout representation and transforms for these.
   
   In implementation the ```IterVar``` which was holding one axis till now will hold a packed axis as ```name=4o4i``` and ```range=16```. The new helpers can be used to retrieve individual axis ```4o``` and ```4c``` when ever needed. The forwards and backwards are enhanced accordingly.


-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [RELAX][LAYOUT] Support multiple axis packing [tvm]

Posted by "srkreddy1238 (via GitHub)" <gi...@apache.org>.
srkreddy1238 commented on code in PR #18657:
URL: https://github.com/apache/tvm/pull/18657#discussion_r2681791695


##########
include/tvm/tir/data_layout.h:
##########
@@ -249,20 +291,23 @@ class Layout : public ObjectRef {
    */
   bool Contains(const LayoutAxis& axis) const {
     if (!defined()) return false;
-    for (const tir::IterVar var : operator->()->axes) {
-      if (var->var->name_hint == axis.name()) {
-        return true;
+    for (const tir::IterVar packed_var : operator->()->axes) {
+      auto iter_vars = UnpackIterVar(packed_var);
+      for (auto var : iter_vars) {
+        if (var->var->name_hint == axis.name()) {
+          return true;
+        }
       }
     }
     return false;
   }
 
-  const LayoutAxis& operator[](int32_t i) const {
+  IterVar operator[](int32_t i) const {

Review Comment:
   Not comfortable with this change though this feature works. Reworking on avoiding this return of ```IterVar```.



-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [RELAX][LAYOUT] Support multiple axis packing [tvm]

Posted by "srkreddy1238 (via GitHub)" <gi...@apache.org>.
srkreddy1238 commented on code in PR #18657:
URL: https://github.com/apache/tvm/pull/18657#discussion_r2681791695


##########
include/tvm/tir/data_layout.h:
##########
@@ -249,20 +291,23 @@ class Layout : public ObjectRef {
    */
   bool Contains(const LayoutAxis& axis) const {
     if (!defined()) return false;
-    for (const tir::IterVar var : operator->()->axes) {
-      if (var->var->name_hint == axis.name()) {
-        return true;
+    for (const tir::IterVar packed_var : operator->()->axes) {
+      auto iter_vars = UnpackIterVar(packed_var);
+      for (auto var : iter_vars) {
+        if (var->var->name_hint == axis.name()) {
+          return true;
+        }
       }
     }
     return false;
   }
 
-  const LayoutAxis& operator[](int32_t i) const {
+  IterVar operator[](int32_t i) const {

Review Comment:
   Not comfortable with this change though this feature works. Reworking on avoiding this return of ```IterVar```.



-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [RELAX][LAYOUT] Support multiple axis packing [tvm]

Posted by "srkreddy1238 (via GitHub)" <gi...@apache.org>.
srkreddy1238 commented on PR #18657:
URL: https://github.com/apache/tvm/pull/18657#issuecomment-3995135429

   Reopened : https://github.com/apache/tvm/pull/18869 


-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [RELAX][LAYOUT] Support multiple axis packing [tvm]

Posted by "srkreddy1238 (via GitHub)" <gi...@apache.org>.
srkreddy1238 closed pull request #18657: [RELAX][LAYOUT] Support multiple axis packing
URL: https://github.com/apache/tvm/pull/18657


-- 
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: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org