You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "spectrometerHBH (via GitHub)" <gi...@apache.org> on 2023/12/14 16:29:36 UTC

[PR] [Codegen] Fix if_then_else codegen [tvm]

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

   Evaluating `op.if_then_else` with `a?b:c` is potentially dangerous as it might evaluate expressions in branches without a guard of condition.


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

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


Re: [PR] [Codegen] Fix if_then_else codegen [tvm]

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

   isn't short circuiting the defined behavior for ternary expression?


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

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


Re: [PR] [Codegen] Fix if_then_else codegen [tvm]

Posted by "jinhongyii (via GitHub)" <gi...@apache.org>.
jinhongyii merged PR #16242:
URL: https://github.com/apache/tvm/pull/16242


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

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


Re: [PR] [Codegen] Fix if_then_else codegen [tvm]

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


##########
src/runtime/ndarray.cc:
##########
@@ -96,6 +96,27 @@ void ArrayCopyToBytes(const DLTensor* handle, void* data, size_t nbytes) {
   DeviceAPI::Get(handle->device)->StreamSync(handle->device, nullptr);
 }
 
+TVM_REGISTER_GLOBAL("mlc.show_dltensor").set_body_typed([](NDArray arr) {

Review Comment:
   remove debug code



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

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


Re: [PR] [Codegen] Fix if_then_else codegen [tvm]

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

   > isn't short circuiting the defined behavior for ternary expression?
   
   When generating codes for `a?b:c`, there might be bindings for b or c generated ahead. These binding codes are not protected by condition a.


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

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


Re: [PR] [Codegen] Fix if_then_else codegen [tvm]

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

   > > isn't short circuiting the defined behavior for ternary expression?
   > 
   > When generating codes for `a?b:c`, there might be bindings for b or c generated ahead. These binding codes are not protected by condition a.
   
   Hi, bohan, I recently am supporting Ternary Operator(like cond?true_branch:false_branch) in our device. I don't understand this modification. Can u explain this with a case? Thanks a lot!


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

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