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/09/22 01:31:13 UTC

[GitHub] [tvm] masahi opened a new pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

masahi opened a new pull request #9069:
URL: https://github.com/apache/tvm/pull/9069


   https://discuss.tvm.apache.org/t/autotvm-auto-scheduler-always-use-the-vm-compiler-for-task-extraction/11092
   
   @comaniac @icemelon 


-- 
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 pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

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


   @comaniac I figured out why task weights are different between graph vs VM compiler. It turns out that the VM compiler never calls `auto_scheduler.relay_integration.te_compiler_update_weights` callback, because the code path below is only used by the graph compiler.
   
   https://github.com/apache/tvm/blob/be37923eca43c5b55793a7162cc5da526ddc8bce/src/relay/backend/te_compiler.cc#L864-L866
   
   Thus, in the VM case, weight is updated only in this line, which doesn't take multiplicity into account. So in VM, all task weights are 1.
   https://github.com/apache/tvm/blob/92903b45659f094df7d41055d3a8da300fe4ff89/python/tvm/auto_scheduler/relay_integration.py#L366
   
   The commit https://github.com/apache/tvm/pull/9069/commits/8c16d40b394f8a837c2b788be1cd821db7eb2fd7 fixed this issue. Now, task weights are identical between graph and VM. 


-- 
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] comaniac commented on pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

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


   Hmm if it's just weight difference maybe we could just let it be. I have no idea why it's the case and your hypothesis makes sense to me.


-- 
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 pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

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


   Something is off in task weights extracted by VM compiler. In the following network (MLP), there is two `dense` ops with identical workload. So there is one task with weight 2. The graph compiler returns the correct weight, but the VM compiler returns 1. Weights returned by the VM compiler are always smaller than the graph compiler.
   
   ```
   def @main(%data: Tensor[(1, 32), float32], %fc1_weight: Tensor[(32, 32), float32], %fc1_bias: Tensor[(32), float32], %fc2_weight: Tensor[(32, 32), float32], %fc2_bias: Tensor[(32), float32]) -> Tensor[(1, 32), float32] {
     %0 = nn.dense(%data, %fc1_weight, units=32) /* ty=Tensor[(1, 32), float32] */;
     %1 = nn.bias_add(%0, %fc1_bias, axis=-1) /* ty=Tensor[(1, 32), float32] */;
     %2 = nn.relu(%1) /* ty=Tensor[(1, 32), float32] */;
     %3 = nn.dense(%2, %fc2_weight, units=32) /* ty=Tensor[(1, 32), float32] */;
     %4 = nn.bias_add(%3, %fc2_bias, axis=-1) /* ty=Tensor[(1, 32), float32] */;
     nn.relu(%4) /* ty=Tensor[(1, 32), float32] */
   }
   ```


-- 
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 #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

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


   


-- 
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 pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

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


   @comaniac Looks like in all cases, task weights are different. Is that expected? I think it is not intuitive (I only swapped the compiler).


-- 
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 edited a comment on pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

Posted by GitBox <gi...@apache.org>.
masahi edited a comment on pull request #9069:
URL: https://github.com/apache/tvm/pull/9069#issuecomment-924629123


   @comaniac Looks like in all cases, task weights are different. Is that expected? It is not clear to me why anything should change (I only swapped the compiler).
   
   Maybe depending on how TE compiler is used, the task extraction process is slightly different?
   
   If it is ok to update the expected weights number according to the VM compiler, I can do that.


-- 
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] comaniac commented on pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

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


   Ah you're right. The TE compiler refactoring introduced this issue and your fix makes perfect sense to me. Thanks!
   cc @jroesch 


-- 
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 edited a comment on pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

Posted by GitBox <gi...@apache.org>.
masahi edited a comment on pull request #9069:
URL: https://github.com/apache/tvm/pull/9069#issuecomment-924629123


   @comaniac Looks like in all cases, task weights are different. Is that expected? I think it is not intuitive (I only swapped the compiler).
   
   Maybe depending on how TE compiler is used, the task extraction process is slightly different?


-- 
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 pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

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


   Not sure what this comment is supposed to mean... Is there something unreasonable about the current task extraction mechanism? 
   
   https://github.com/apache/tvm/blob/be37923eca43c5b55793a7162cc5da526ddc8bce/src/relay/backend/te_compiler.cc#L862-L863


-- 
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] comaniac commented on pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

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


   Looks like some test cases were failed due to unexpected extracted task number. Could you take a look to make sure their behavior are expected? It should be good to go once CI is green.


-- 
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 edited a comment on pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

Posted by GitBox <gi...@apache.org>.
masahi edited a comment on pull request #9069:
URL: https://github.com/apache/tvm/pull/9069#issuecomment-924741600


   Not sure what this comment is supposed to mean... Is there something unreasonable about the current task extraction mechanism? I'm happy to work on it if there is a room for improvement.
   
   https://github.com/apache/tvm/blob/be37923eca43c5b55793a7162cc5da526ddc8bce/src/relay/backend/te_compiler.cc#L862-L863


-- 
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 edited a comment on pull request #9069: [AutoTVM, Auto scheduler] Always use VM compiler for task extraction

Posted by GitBox <gi...@apache.org>.
masahi edited a comment on pull request #9069:
URL: https://github.com/apache/tvm/pull/9069#issuecomment-924629123


   @comaniac Looks like in all cases, task weights are different. Is that expected? It is not clear to me why anything should change (I only swapped the compiler).
   
   Maybe depending on how TE compiler is used, the task extraction process is slightly different?


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