ekalda commented on PR #16782:
URL: https://github.com/apache/tvm/pull/16782#issuecomment-2037036256

   Thanks for all the reviews and discussion! The latest version now includes 
changes as a response to @lhutton1 review. I also looked into using the target 
info in the LoopVectorizer and discovered several issues, which I think will 
need fixes in separate patches:
   
   * Due to rather complex nesting of pass pipelines in the build process, 
`VectorizeLoop` gets called several times, first from `Build: FoldConstant: 
FoldConstantExpr: ConstEvaluate: LowerTE: LowerTensorExpr` and then from 
`Build: FoldConstant: FoldConstantExpr: ConstEvaluate` and then again in 
`Build: GraphExecutorCodegen: LowerTE: LowerTensorExpr` (this is all for TVMC 
-> graph executor codegen)
   * `BindTarget` is not run before `VectorizeLoop` in `Build: FoldConstant: 
FoldConstantExpr: ConstEvaluate: LowerTE: LowerTensorExpr` invocation, so the 
`attr` won't have target into in `VectorizeLoop`
   * For the cases when `BindTarget` has run before `VectorizeLoop`, it does 
not seem to be binding the target correctly (it's using the default 
`"x86_64-pc-linux-gnu"` instead of the user specified `"aarch64-linux-gnu"`)
   * Another option is to fetch the "global" target through 
`Target::Current()`, but for a reason I've yet to track down it doesn't 
correctly resolve the target in all of the invocations of the `VectorizeLoop` 
and sometimes uses the default target again
   
   So a bit of a can of worms there. I agree with @Lunderberg that in its 
current form the pass would not introduce errors that would have not been 
errors in other places of the stack, so I suggest we deal with the target 
detection issues separately and solidify `VectorizeLoop` with the target info 
at a later stage.


-- 
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: commits-unsubscr...@tvm.apache.org

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

Reply via email to