You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/04/29 09:31:52 UTC

[GitHub] [tvm] hgt312 opened a new pull request #7943: [autodiff] change `truncdiv` to `div` in EliminateDivModMutator

hgt312 opened a new pull request #7943:
URL: https://github.com/apache/tvm/pull/7943


   With this change, I can use `te.gradient` on `roi_align`. Otherwise, there will be:
   
   ```
   TVMError:
   ---------------------------------------------------------------
   An internal invariant was violated during the execution of TVM.
   Please read TVM's error reporting guidelines.
   More details can be found here: https://discuss.tvm.ai/t/error-reporting/7793.
   ---------------------------------------------------------------
     Check failed: (a.dtype().is_int() || a.dtype().is_uint()) is false: ((float32(rv) + 0.5f)*(max((placeholder[i, 4] - placeholder[i, 2]), 1f)*0.142857f))
   Stack trace:
     File "../3rdparty/tvm/src/tir/op/op.cc", line 343
     [bt] (0) 1   libtvm.dylib                        0x00000001275ea4ce tvm::runtime::Backtrace() + 30
     [bt] (1) 2   libtvm.dylib                        0x00000001245cc7c5 tvm::runtime::detail::LogFatal::Entry::Finalize() + 149
     [bt] (2) 3   libtvm.dylib                        0x00000001245cc71d tvm::runtime::detail::LogFatal::~LogFatal() + 29
     [bt] (3) 4   libtvm.dylib                        0x00000001245ca465 tvm::runtime::detail::LogFatal::~LogFatal() + 21
     [bt] (4) 5   libtvm.dylib                        0x00000001255a7e1e tvm::truncdiv(tvm::PrimExpr, tvm::PrimExpr, tvm::Span) + 318
     [bt] (5) 6   libtvm.dylib                        0x0000000125017b46 tvm::te::EliminateDivModMutator::VisitExpr_(tvm::tir::DivNode const*) + 1670
     [bt] (6) 7   libtvm.dylib                        0x000000012462f59f tvm::tir::ExprFunctor<tvm::PrimExpr (tvm::PrimExpr const&)>::InitVTable()::'lambda9'(tvm::runtime::ObjectRef const&, tvm::tir::ExprFunctor<tvm::PrimExpr (tvm::PrimExpr const&)>*)::operator()(tvm::runtime::ObjectRef const&, tvm::tir::ExprFunctor<tvm::PrimExpr (tvm::PrimExpr const&)>*) const + 79
     [bt] (7) 8   libtvm.dylib                        0x000000012462f544 tvm::tir::ExprFunctor<tvm::PrimExpr (tvm::PrimExpr const&)>::InitVTable()::'lambda9'(tvm::runtime::ObjectRef const&, tvm::tir::ExprFunctor<tvm::PrimExpr (tvm::PrimExpr const&)>*)::__invoke(tvm::runtime::ObjectRef const&, tvm::tir::ExprFunctor<tvm::PrimExpr (tvm::PrimExpr const&)>*) + 36
     [bt] (8) 9   libtvm.dylib                        0x0000000124629740 tvm::NodeFunctor<tvm::PrimExpr (tvm::runtime::ObjectRef const&, tvm::tir::ExprFunctor<tvm::PrimExpr (tvm::PrimExpr const&)>*)>::operator()(tvm::runtime::ObjectRef const&, tvm::tir::ExprFunctor<tvm::PrimExpr (tvm::PrimExpr const&)>*) const + 464
   ```
   
   @yzhliu 


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

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



[GitHub] [tvm] yzhliu merged pull request #7943: [autodiff] change `truncdiv` to `div` in EliminateDivModMutator

Posted by GitBox <gi...@apache.org>.
yzhliu merged pull request #7943:
URL: https://github.com/apache/tvm/pull/7943


   


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

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



[GitHub] [tvm] yzhliu commented on pull request #7943: [autodiff] change `truncdiv` to `div` in EliminateDivModMutator

Posted by GitBox <gi...@apache.org>.
yzhliu commented on pull request #7943:
URL: https://github.com/apache/tvm/pull/7943#issuecomment-829739285


   Thanks @hgt312 @sergei-grechanik 


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

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



[GitHub] [tvm] sergei-grechanik commented on pull request #7943: [autodiff] change `truncdiv` to `div` in EliminateDivModMutator

Posted by GitBox <gi...@apache.org>.
sergei-grechanik commented on pull request #7943:
URL: https://github.com/apache/tvm/pull/7943#issuecomment-829543534


   So the problem is that DivNode may be used for both integers and floats, but truncdiv checks that its arguments are actually integers. The change looks correct. I don't think that we need to change the ModNode case, I guess it cannot be used with floats, although I'm not 100% sure about that (but it seems, truncmod doesn't check if the arguments are integers, at least not directly). 


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

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