MasterJH5574 commented on a change in pull request #8716:
URL: https://github.com/apache/tvm/pull/8716#discussion_r688912248



##########
File path: src/tir/transforms/flatten_buffer.cc
##########
@@ -140,7 +140,10 @@ class BufferFlattener : public StmtExprMutator {
                      /*var=*/std::move(var),
                      /*iter_type=*/IterVarType::kThreadIndex,
                      /*thread_tag=*/thread_tag);
-    String attr_key = thread_tag == "vthread" ? attr::virtual_thread : 
attr::thread_extent;
+    String attr_key = (thread_tag == "vthread" || thread_tag == "vthread.x" ||
+                       thread_tag == "vthread.y" || thread_tag == "vthread.z")
+                          ? attr::virtual_thread
+                          : attr::thread_extent;

Review comment:
       Besides, I want to confirm the semantics of "binding two loops to 
`vthread.x`".
   
   If we bind only one loop to `vthread` or `vthread.x`, the loop will be kept 
in its place (I mean, it won't be moved to an outer position). But if we bind 
two loops to `vthread.x`, we definitely cannot keep both of them in their 
places, and the only way seems to be removing the two loops, and wrap a new 
loop at the outermost position representing the `vthread.x`.
   
   This solution might incur a new problem needing consideration, because if we 
bind two loops to `vthread.x` and two loops to `vthread.y` simultaneously, what 
is the order of the two new loops representing `vthread.x` and `vthread.y`? The 
loop of `vthread.x` is always outer than that of `vthread.y`, or some other 
design?




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