You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "Lunderberg (via GitHub)" <gi...@apache.org> on 2023/05/30 18:17:08 UTC
[GitHub] [tvm] Lunderberg opened a new pull request, #14988: [TIR] Handle callees on same target, different codegen
Lunderberg opened a new pull request, #14988:
URL: https://github.com/apache/tvm/pull/14988
Prior to this commit, any caller that uses a different `Target` than its callee is lowered to a device-kernel launch. However, if the caller and callee are on the same device, despite using a different target (e.g. `Target("llvm")` and `Target("c")` both use `kDLCPU`), then the kernel launch is unnecessary.
This commit updates `LowerDeviceKernelLaunch` to produce a kernel launch only when the callee is on another device, and to produce `T.call_extern` for callees on the same device.
--
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
[GitHub] [tvm] Lunderberg commented on a diff in pull request #14988: [TIR] Handle callees on same target, different codegen
Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on code in PR #14988:
URL: https://github.com/apache/tvm/pull/14988#discussion_r1215763159
##########
src/tir/transforms/lower_device_kernel_launch.cc:
##########
@@ -243,6 +275,7 @@ class DeviceKernelMutator : public StmtExprMutator {
Optional<Target> current_target_;
std::unordered_map<const GlobalVarNode*, KernelInfo> device_info_map_;
std::unordered_set<const GlobalVarNode*> device_kernel_launch_;
+ std::unordered_set<const GlobalVarNode*> extern_method_call_;
Review Comment:
Good point, and renamed `extern_method_call_` to `extern_function_call_`.
--
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
[GitHub] [tvm] masahi commented on a diff in pull request #14988: [TIR] Handle callees on same target, different codegen
Posted by "masahi (via GitHub)" <gi...@apache.org>.
masahi commented on code in PR #14988:
URL: https://github.com/apache/tvm/pull/14988#discussion_r1214872735
##########
src/tir/transforms/lower_device_kernel_launch.cc:
##########
@@ -243,6 +275,7 @@ class DeviceKernelMutator : public StmtExprMutator {
Optional<Target> current_target_;
std::unordered_map<const GlobalVarNode*, KernelInfo> device_info_map_;
std::unordered_set<const GlobalVarNode*> device_kernel_launch_;
+ std::unordered_set<const GlobalVarNode*> extern_method_call_;
Review Comment:
`method` -> `func`? Since we don't use that term.
--
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
[GitHub] [tvm] Lunderberg commented on pull request #14988: [TIR] Handle callees on same target, different codegen
Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on PR #14988:
URL: https://github.com/apache/tvm/pull/14988#issuecomment-1575156915
Similar to https://github.com/apache/tvm/pull/14951, rebased this PR on top of main, now that https://github.com/apache/tvm/pull/14982 has landed.
--
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
[GitHub] [tvm] masahi merged pull request #14988: [TIR] Handle callees on same target, different codegen
Posted by "masahi (via GitHub)" <gi...@apache.org>.
masahi merged PR #14988:
URL: https://github.com/apache/tvm/pull/14988
--
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
[GitHub] [tvm] tvm-bot commented on pull request #14988: [TIR] Handle callees on same target, different codegen
Posted by "tvm-bot (via GitHub)" <gi...@apache.org>.
tvm-bot commented on PR #14988:
URL: https://github.com/apache/tvm/pull/14988#issuecomment-1568869428
<!---bot-comment-->
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
<!--bot-comment-ccs-start-->
* cc @Hzfengsy, @junrushao, @quic-sanirudh, @shingjan <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
<sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>
--
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
[GitHub] [tvm] Lunderberg commented on pull request #14988: [TIR] Handle callees on same target, different codegen
Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on PR #14988:
URL: https://github.com/apache/tvm/pull/14988#issuecomment-1568870837
This is a subset of functionality from https://github.com/apache/tvm/pull/14862, split out into an independent PR for ease of testing and review.
--
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