masahi commented on pull request #8366:
URL: https://github.com/apache/tvm/pull/8366#issuecomment-871942607


   @tqchen I've hit an issue in `lower_thread_allreduce.cc`. There are multiple 
uses of `AttrStmt` where a storage scope of a buffer variable is assigned after 
some complicated logic, like this:
   
https://github.com/apache/tvm/blob/ae58f2c387de9944d241a083ce9a0dd4c9ae613d/src/tir/transforms/lower_thread_allreduce.cc#L94
   
   So I tried to replace this line by something like 
`SetStorageScope(repl->buffer_var, "shared")` but this doesn't work because I 
cannot get a mutable pointer to `PointerType` via 
`buffer_var->type_annotation.as<PointerTypeNode>()`. 
   
   Creating a new variable also doesn't work because the old `buffer_var` is 
[shared 
](https://github.com/apache/tvm/blob/ae58f2c387de9944d241a083ce9a0dd4c9ae613d/src/tir/transforms/lower_thread_allreduce.cc#L354-L359)
 with other stmt nodes, so updating the `buffer_var` of `AllocateNode` results 
in the use of undefined variable in other nodes.
   
   What should we do about this?


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