You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "yongwww (via GitHub)" <gi...@apache.org> on 2023/08/01 05:42:33 UTC
[GitHub] [tvm] yongwww opened a new pull request, #15447: [Unity] Multi-device support for Relax
yongwww opened a new pull request, #15447:
URL: https://github.com/apache/tvm/pull/15447
This PR is specifically for the P1 & P2 of #15101, some additional scenarios and more test cases will be pushed soon. Any early reviews are welcome.
--
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] tqchen commented on pull request #15447: [Unity] Multi-device support for Relax
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on PR #15447:
URL: https://github.com/apache/tvm/pull/15447#issuecomment-1675267593
Thank you @yongwww ! this is merged
--
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] yongwww commented on pull request #15447: [Unity] Multi-device support for Relax
Posted by "yongwww (via GitHub)" <gi...@apache.org>.
yongwww commented on PR #15447:
URL: https://github.com/apache/tvm/pull/15447#issuecomment-1665982616
cc: @tqchen @psrivas2 @junrushao @csullivan @slyubomirsky
--
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] yongwww commented on a diff in pull request #15447: [Unity] Multi-device support for Relax
Posted by "yongwww (via GitHub)" <gi...@apache.org>.
yongwww commented on code in PR #15447:
URL: https://github.com/apache/tvm/pull/15447#discussion_r1287449778
##########
include/tvm/relax/struct_info.h:
##########
@@ -180,17 +184,20 @@ class TensorStructInfoNode : public StructInfoNode {
void VisitAttrs(AttrVisitor* v) {
v->Visit("shape", &shape);
v->Visit("dtype", &dtype);
+ v->Visit("vdevice", &vdevice);
v->Visit("ndim", &ndim);
v->Visit("span", &span);
}
bool SEqualReduce(const TensorStructInfoNode* other, SEqualReducer equal) const {
- return equal(shape, other->shape) && equal(ndim, other->ndim) && equal(dtype, other->dtype);
+ return equal(shape, other->shape) && equal(ndim, other->ndim) &&
+ equal(vdevice, other->vdevice) && equal(dtype, other->dtype);
Review Comment:
[the updater](https://github.com/apache/tvm/pull/15447/files#diff-1a7f4665eeaa8ac3b32bb983b901e52eee4a2e38661c507e1902bd6c46ce7785R60-R72) was added in the new commit. Currently we don't have version management for Unity branch, I used `0.13` as the from_version, `0.14` as the to_version after the upgrade in the updater.
--
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] tqchen commented on a diff in pull request #15447: [Unity] Multi-device support for Relax
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on code in PR #15447:
URL: https://github.com/apache/tvm/pull/15447#discussion_r1284736974
##########
src/relay/backend/contrib/cmsisnn/target.cc:
##########
@@ -31,13 +31,14 @@ namespace contrib {
namespace cmsisnn {
tvm::transform::Pass RelayToTIR();
+using FTVMTIRToRuntime = runtime::TypedPackedFunc<runtime::Module(IRModule, Target)>;
runtime::Module TIRToRuntime(IRModule mod, Target target);
TVM_REGISTER_TARGET_KIND("cmsis-nn", kDLCPU)
.add_attr_option<Array<String>>("mattr")
.add_attr_option<String>("mcpu")
.add_attr_option<Bool>("debug_last_error")
- .set_attr<FTVMRelayToTIR>(tvm::attr::kRelayToTIR, RelayToTIR())
+ .set_attr<tvm::transform::Pass>(tvm::attr::kRelayToTIR, RelayToTIR())
Review Comment:
Maybe we don't need these changes
--
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] yongwww commented on a diff in pull request #15447: [Unity] Multi-device support for Relax
Posted by "yongwww (via GitHub)" <gi...@apache.org>.
yongwww commented on code in PR #15447:
URL: https://github.com/apache/tvm/pull/15447#discussion_r1287443974
##########
src/relay/backend/contrib/cmsisnn/target.cc:
##########
@@ -31,13 +31,14 @@ namespace contrib {
namespace cmsisnn {
tvm::transform::Pass RelayToTIR();
+using FTVMTIRToRuntime = runtime::TypedPackedFunc<runtime::Module(IRModule, Target)>;
runtime::Module TIRToRuntime(IRModule mod, Target target);
TVM_REGISTER_TARGET_KIND("cmsis-nn", kDLCPU)
.add_attr_option<Array<String>>("mattr")
.add_attr_option<String>("mcpu")
.add_attr_option<Bool>("debug_last_error")
- .set_attr<FTVMRelayToTIR>(tvm::attr::kRelayToTIR, RelayToTIR())
+ .set_attr<tvm::transform::Pass>(tvm::attr::kRelayToTIR, RelayToTIR())
Review Comment:
I am planning to submit my update for the Target to the main branch. In the current Target implementation, there is a dependency on IRModule : `target.h -> target_kind.h - > transform.h - > module.h`. In this pr, we introduced Target as a member of VDevice, and VDevice could be part of the global_infos of IRModule, leading to the dependency `module.h->target.h`", resulting in circular dependencies. My changes are trying to resolve this issue by removing the dependency of IRModule on Target.
--
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 #15447: [Unity] Multi-device support for Relax
Posted by "tvm-bot (via GitHub)" <gi...@apache.org>.
tvm-bot commented on PR #15447:
URL: https://github.com/apache/tvm/pull/15447#issuecomment-1659602650
<!---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 @quic-sanirudh <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] tqchen commented on a diff in pull request #15447: [Unity] Multi-device support for Relax
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on code in PR #15447:
URL: https://github.com/apache/tvm/pull/15447#discussion_r1284736236
##########
src/relay/backend/contrib/cmsisnn/target.cc:
##########
@@ -31,13 +31,14 @@ namespace contrib {
namespace cmsisnn {
tvm::transform::Pass RelayToTIR();
+using FTVMTIRToRuntime = runtime::TypedPackedFunc<runtime::Module(IRModule, Target)>;
runtime::Module TIRToRuntime(IRModule mod, Target target);
TVM_REGISTER_TARGET_KIND("cmsis-nn", kDLCPU)
.add_attr_option<Array<String>>("mattr")
.add_attr_option<String>("mcpu")
.add_attr_option<Bool>("debug_last_error")
- .set_attr<FTVMRelayToTIR>(tvm::attr::kRelayToTIR, RelayToTIR())
+ .set_attr<tvm::transform::Pass>(tvm::attr::kRelayToTIR, RelayToTIR())
Review Comment:
these changes maybe should goto main?
--
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] tqchen merged pull request #15447: [Unity] Multi-device support for Relax
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #15447:
URL: https://github.com/apache/tvm/pull/15447
--
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] tqchen commented on a diff in pull request #15447: [Unity] Multi-device support for Relax
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on code in PR #15447:
URL: https://github.com/apache/tvm/pull/15447#discussion_r1284738374
##########
include/tvm/relax/struct_info.h:
##########
@@ -180,17 +184,20 @@ class TensorStructInfoNode : public StructInfoNode {
void VisitAttrs(AttrVisitor* v) {
v->Visit("shape", &shape);
v->Visit("dtype", &dtype);
+ v->Visit("vdevice", &vdevice);
v->Visit("ndim", &ndim);
v->Visit("span", &span);
}
bool SEqualReduce(const TensorStructInfoNode* other, SEqualReducer equal) const {
- return equal(shape, other->shape) && equal(ndim, other->ndim) && equal(dtype, other->dtype);
+ return equal(shape, other->shape) && equal(ndim, other->ndim) &&
+ equal(vdevice, other->vdevice) && equal(dtype, other->dtype);
Review Comment:
This changes the json format, would be good to add a unity updater here https://github.com/apache/tvm/blob/main/python/tvm/ir/json_compact.py#L60 to upgrade the json so when we load older versions they still work
--
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