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

   ### Behavior before correction
   
   When Ansor doesn't find a schedule for a layer during tuning, like this:
   
   ```
   tvmgen_default_fused_nn_conv2d_28
   Cannot find tuned schedules for target=llvm -keys=cpu 
-mtriple=x86_64-pc-linux-gnu, workload_key=["2d10de6646307f0e3e5cf4b31c20e69b", 
[1, 7, 7, 960], [1, 1, 960, 320], [1, 7, 7, 320]]. A fallback TOPI schedule is 
used, which may bring great performance regression or even compilation failure. 
Compute DAG info:
   p0 = PLACEHOLDER [1, 7, 7, 960]
   pad_temp(i0, i1, i2, i3) = p0[i0, i1, i2, i3]
   p1 = PLACEHOLDER [1, 1, 960, 320]
   conv2d_nhwc(nn, yy, xx, ff) += (pad_temp[nn, (yy + ry), (xx + rx), 
rc]*p1[ry, rx, rc, ff])
   ```
   
   I was getting model compilation failures like this
   
   InternalError: Check failed: (false) is false: Incompatible broadcast dims: 
144 and 128 in: [1, 7, 7, 144] and [1, 1, 1, 128]
   
   ### Behavior after correction
   
   Now, When Ansor doesn't find a schedule for a layer during tuning, like this:
   
   ```
   fused_nn_dense_add
   Cannot find tuned schedules for target=llvm -keys=cpu 
-mtriple=x86_64-pc-linux-gnu, workload_key=["08f7449d79e570b7274174709e5e5e01", 
[1, 1280], [1000, 1280], [1, 1000], [1, 1000]]. A fallback TOPI schedule is 
used, which may bring great performance regression or even compilation failure. 
Compute DAG info:
   p0 = PLACEHOLDER [1, 1280]
   p1 = PLACEHOLDER [1000, 1280]
   T_matmul_NT(i0, i1) += (p0[i0, k]*p1[i1, k])
   p2 = PLACEHOLDER [1, 1000]
   T_add(ax0, ax1) = (T_matmul_NT[ax0, ax1] + p2[ax0, ax1])
   ```
   
   the code reports the following warning
   
   ```
   [00:50:32] /home/thais/Dev/tvm/include/tvm/topi/detail/broadcast.h:86: 
Warning: Incompatible broadcast dims: 256 and 96. Automatically cutting the 
larger dimension.
   [00:50:33] /home/thais/Dev/tvm/include/tvm/topi/detail/broadcast.h:86: 
Warning: Incompatible broadcast dims: 256 and 160. Automatically cutting the 
larger dimension.
   ```
   
   And, I can compile the models without compilation and execution errors and 
the accuracy of the model is maintained.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to