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 2020/10/10 07:37:07 UTC

[GitHub] [incubator-tvm] merrymercy opened a new pull request #6660: [AutoScheduler] Improve the GPU tutorial by deleting measure_ctx earlier

merrymercy opened a new pull request #6660:
URL: https://github.com/apache/incubator-tvm/pull/6660


   To avoid the confusion in #6570, we call `del measure_ctx` earlier in the tutorial, just after we finish the search.
   
   `measure_ctx` overloads the `__del__`. Ideally, we do not need to call `del measure_ctx` explicitly.
   However, I found `__del__` only works for local variables.
   If we use `measure_ctx` as a local variable inside a function, it can be garbage-collected correctly.
   But in the tutorial, which is a single script, the `measure_ctx` is a global varaible. Then it cannot be garbage-collected correctly.
   
   There are two ways to solve this problem.
   **S1**. call `del measure_ctx` explicitly
   **S2**. use 
   ```
   with measure_ctx:
     tune_options = ...
     s, args = auto_scheduler.auto_schedule(...)
   ```
   
   I vote for **S1**. In **S1**, `del measure_ctx` is only required if `measure_ctx` is a global varaible, which is a rare case.
   


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

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



[GitHub] [incubator-tvm] merrymercy commented on a change in pull request #6660: [AutoScheduler] Improve the GPU tutorial by deleting measure_ctx earlier

Posted by GitBox <gi...@apache.org>.
merrymercy commented on a change in pull request #6660:
URL: https://github.com/apache/incubator-tvm/pull/6660#discussion_r502869803



##########
File path: tutorials/auto_scheduler/tune_conv2d_layer_cuda.py
##########
@@ -63,7 +63,7 @@ def conv2d_layer(N, H, W, CO, CI, KH, KW, stride, padding):
 
 target = tvm.target.Target("cuda")
 
-# the last layer in resnet
+# Use the last layer in resnet

Review comment:
       ```suggestion
   # Use the last layer in ResNet-50
   ```




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

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



[GitHub] [incubator-tvm] merrymercy commented on pull request #6660: [AutoScheduler] Improve the GPU tutorial by deleting measure_ctx earlier

Posted by GitBox <gi...@apache.org>.
merrymercy commented on pull request #6660:
URL: https://github.com/apache/incubator-tvm/pull/6660#issuecomment-706505225


   cc @jcf94 @luchangli03 


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

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



[GitHub] [incubator-tvm] merrymercy merged pull request #6660: [AutoScheduler] Improve the GPU tutorial by deleting measure_ctx earlier

Posted by GitBox <gi...@apache.org>.
merrymercy merged pull request #6660:
URL: https://github.com/apache/incubator-tvm/pull/6660


   


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

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