You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "srkreddy1238 (via GitHub)" <gi...@apache.org> on 2023/01/25 13:10:10 UTC

[GitHub] [tvm] srkreddy1238 opened a new pull request, #13843: [RUNTIME][CLML] OpenCLML tuning and profiling enhanced

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

   Tuning cache bin is serialized through DMLC::Stream to support multiple CLML sub graphs with in a tvm module. Individual tuning cache blobs are saved to same output file.
   
   New API on OpenCLWorkspace to enable or disable profiling on command queue rather doing this only when Timer is invoked. This is required to perform CLML operator tuning.
   
   CLML layer profiling now uses OpenCL Timer interface.
   
   This PR also fix avoiding pad operator offloading at the very first layer (to be specific before at least one convolution layer) due to the limitation of CLML pad operator is concerned about layout. Please refer to CLML SDK documentation for more details.


-- 
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] echuraev commented on a diff in pull request #13843: [RUNTIME][CLML] OpenCLML tuning and profiling enhanced

Posted by "echuraev (via GitHub)" <gi...@apache.org>.
echuraev commented on code in PR #13843:
URL: https://github.com/apache/tvm/pull/13843#discussion_r1087785621


##########
src/runtime/opencl/opencl_common.h:
##########
@@ -508,26 +531,11 @@ class OpenCLTimerNode : public TimerNode {
   Device dev_;
 
   void recreateCommandQueue() {
-    cl_command_queue_properties prop;
-
     if (!cl::OpenCLWorkspace::Global()->IsProfiling(dev_)) {
-      prop = CL_QUEUE_PROFILING_ENABLE;
+      cl::OpenCLWorkspace::Global()->EnableQueueProfiling(dev_, true);

Review Comment:
   Probably it will be better to do in such way:
   ```c++
   cl::OpenCLWorkspace::Global()->EnableQueueProfiling(dev_, !cl::OpenCLWorkspace::Global()->IsProfiling(dev_));
   ```



##########
src/runtime/contrib/clml/clml_runtime.cc:
##########
@@ -281,32 +310,34 @@ class CLMLRuntime : public JSONRuntimeBase {
       }
     }
 
+    int64_t duration = 0;
     for (size_t i = 0; i < this->layer_.function.size(); ++i) {
       // Make CLML subgraphs accounted by OpenCLTimerNode.
-      if (getenv("CLML_PROFILING") || workspace->IsProfiling(tentry->device)) {
+
+      // if (workspace->IsProfiling(tentry->device)) {

Review Comment:
   This comment can be removed?



##########
src/runtime/opencl/opencl_common.h:
##########
@@ -284,6 +284,29 @@ class OpenCLWorkspace : public DeviceAPI {
 
     return prop & CL_QUEUE_PROFILING_ENABLE;
   }
+  // Enable queue profiling, recreate if required
+  void EnableQueueProfiling(Device dev, bool enable) {
+    bool is_enabled = cl::OpenCLWorkspace::Global()->IsProfiling(dev);
+    if (is_enabled == enable) {
+      return;
+    }
+    cl_command_queue_properties prop = 0;
+    if (enable) {
+      prop = CL_QUEUE_PROFILING_ENABLE;
+    } else {
+      prop = 0;
+    }

Review Comment:
   ```suggestion
       cl_command_queue_properties prop = (enable) ? CL_QUEUE_PROFILING_ENABLE : 0;
   ```



-- 
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 #13843: [RUNTIME][CLML] OpenCLML tuning and profiling enhanced

Posted by "tvm-bot (via GitHub)" <gi...@apache.org>.
tvm-bot commented on PR #13843:
URL: https://github.com/apache/tvm/pull/13843#issuecomment-1403583526

   <!---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 @areusch <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] echuraev merged pull request #13843: [RUNTIME][CLML] OpenCLML tuning and profiling enhanced

Posted by "echuraev (via GitHub)" <gi...@apache.org>.
echuraev merged PR #13843:
URL: https://github.com/apache/tvm/pull/13843


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