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 2022/11/15 00:39:17 UTC

[GitHub] [tvm] zxybazh opened a new pull request, #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

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

   This PR introduces default schedule rules, post processors and mutators for LLVM VNNI targets. The usage of default vnni classes will automatically be generated if using `from-target` as parameters.
   
   Co-authored-by: Michal Piszczek <mi...@uw.edu>


-- 
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] vinx13 commented on a diff in pull request #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
vinx13 commented on code in PR #13383:
URL: https://github.com/apache/tvm/pull/13383#discussion_r1022235387


##########
src/meta_schedule/postproc/postproc.cc:
##########
@@ -59,6 +59,14 @@ Array<Postproc> Postproc::DefaultLLVM() {
   };
 }
 
+Array<Postproc> Postproc::DefaultVNNI() {
+  return Array<Postproc>{
+      Postproc::DisallowDynamicLoop(),   Postproc::RewriteParallelVectorizeUnroll(),
+      Postproc::RewriteReductionBlock(), Postproc::RewriteTensorize(/*vectorize_init_loop=*/true),
+      Postproc::RewriteLayout(),

Review Comment:
   I think it's useful as a fallback when auto tensorization can't apply



-- 
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 #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13383:
URL: https://github.com/apache/tvm/pull/13383#discussion_r1022206412


##########
src/meta_schedule/schedule_rule/schedule_rule.cc:
##########
@@ -85,6 +85,39 @@ Array<ScheduleRule> ScheduleRule::DefaultLLVM() {
   };
 }
 
+Array<ScheduleRule> ScheduleRule::DefaultVNNI() {
+  return {
+      ScheduleRule::AutoInline(

Review Comment:
   oops @vinx13 has beaten me by 30 seconds...



-- 
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 #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13383:
URL: https://github.com/apache/tvm/pull/13383#discussion_r1022238969


##########
src/meta_schedule/postproc/postproc.cc:
##########
@@ -59,6 +59,14 @@ Array<Postproc> Postproc::DefaultLLVM() {
   };
 }
 
+Array<Postproc> Postproc::DefaultVNNI() {
+  return Array<Postproc>{
+      Postproc::DisallowDynamicLoop(),   Postproc::RewriteParallelVectorizeUnroll(),
+      Postproc::RewriteReductionBlock(), Postproc::RewriteTensorize(/*vectorize_init_loop=*/true),
+      Postproc::RewriteLayout(),

Review Comment:
   I'm cool with this as long as `RewriteLayout` doesn't break tensorization.



-- 
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] vinx13 commented on a diff in pull request #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
vinx13 commented on code in PR #13383:
URL: https://github.com/apache/tvm/pull/13383#discussion_r1022205693


##########
src/meta_schedule/schedule_rule/schedule_rule.cc:
##########
@@ -85,6 +85,39 @@ Array<ScheduleRule> ScheduleRule::DefaultLLVM() {
   };
 }
 
+Array<ScheduleRule> ScheduleRule::DefaultVNNI() {
+  return {
+      ScheduleRule::AutoInline(
+          /*into_producer=*/false,
+          /*into_consumer=*/true,
+          /*inline_const_tensor=*/true,
+          /*disallow_if_then_else=*/true,
+          /*require_injective=*/true,
+          /*require_ordered=*/true,
+          /*disallow_op=*/Array<String>{"tir.exp"}),
+      ScheduleRule::AddRFactor(
+          /*max_jobs_per_core=*/16,
+          /*max_innermost_factor=*/Integer(64)),
+      ScheduleRule::MultiLevelTilingWithIntrin(

Review Comment:
   need to add `MultiLevelTiling` (with the config in default llvm) as a fallback when tensorization is not applicable 



##########
src/meta_schedule/schedule_rule/schedule_rule.cc:
##########
@@ -85,6 +85,39 @@ Array<ScheduleRule> ScheduleRule::DefaultLLVM() {
   };
 }
 
+Array<ScheduleRule> ScheduleRule::DefaultVNNI() {
+  return {
+      ScheduleRule::AutoInline(

Review Comment:
   We recently added new schedule rules `ApplyCustomRule` and `InlineConstantScalars` for llvm, let's also add them here for consistency



-- 
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 #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13383:
URL: https://github.com/apache/tvm/pull/13383#discussion_r1022209494


##########
src/meta_schedule/postproc/postproc.cc:
##########
@@ -59,6 +59,14 @@ Array<Postproc> Postproc::DefaultLLVM() {
   };
 }
 
+Array<Postproc> Postproc::DefaultVNNI() {
+  return Array<Postproc>{
+      Postproc::DisallowDynamicLoop(),   Postproc::RewriteParallelVectorizeUnroll(),
+      Postproc::RewriteReductionBlock(), Postproc::RewriteTensorize(/*vectorize_init_loop=*/true),
+      Postproc::RewriteLayout(),

Review Comment:
   Is `RewriteLayout` useful here? Since VNNI expects the layout of the weight to be fixed.



-- 
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] zxybazh commented on pull request #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
zxybazh commented on PR #13383:
URL: https://github.com/apache/tvm/pull/13383#issuecomment-1314607397

   Thanks for the comments, the previous implementation was based on an earlier commit, now the schedule rules have been added.


-- 
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 #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
tvm-bot commented on PR #13383:
URL: https://github.com/apache/tvm/pull/13383#issuecomment-1314598471

   <!---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.
   
   
   
   <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] zxybazh commented on pull request #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
zxybazh commented on PR #13383:
URL: https://github.com/apache/tvm/pull/13383#issuecomment-1314601703

   CC @michalpiszczek @vinx13 @junrushao @masahi 


-- 
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 #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13383:
URL: https://github.com/apache/tvm/pull/13383#discussion_r1022209990


##########
include/tvm/meta_schedule/mutator.h:
##########
@@ -131,6 +131,8 @@ class Mutator : public runtime::ObjectRef {
                                    FApply f_apply, FClone f_clone, FAsString f_as_string);
   /*! \brief Create default mutators for LLVM */
   TVM_DLL static Map<Mutator, FloatImm, void> DefaultLLVM();
+  /*! \brief Create default mutators for LLVM VNNI */

Review Comment:
   Replace "LLVM VNNI" with "x86 VNNI". Same for `postproc.h` and `schedule_rule.h`



-- 
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 #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13383:
URL: https://github.com/apache/tvm/pull/13383#discussion_r1022206036


##########
src/meta_schedule/schedule_rule/schedule_rule.cc:
##########
@@ -85,6 +85,39 @@ Array<ScheduleRule> ScheduleRule::DefaultLLVM() {
   };
 }
 
+Array<ScheduleRule> ScheduleRule::DefaultVNNI() {
+  return {
+      ScheduleRule::AutoInline(

Review Comment:
   I think you need to add `ApplyCustomRule` at the beginning, as of last week. Otherwise the fix in https://github.com/apache/tvm/pull/13346 won't be applied.



-- 
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] zxybazh merged pull request #13383: [MetaSchedule] Add `from-target` Defaults for LLVM VNNI Targets

Posted by GitBox <gi...@apache.org>.
zxybazh merged PR #13383:
URL: https://github.com/apache/tvm/pull/13383


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