yzhliu commented on issue #4486: [Arith] Bound for Shape Variables
URL: https://github.com/apache/incubator-tvm/pull/4486#issuecomment-569344790
 
 
   @tqchen do you have any idea why this is failing (I cannot reproduce 
locally, and seems to be flaky) 
https://ci.tvm.ai/blue/organizations/jenkins/tvm/detail/PR-4486/13/pipeline#step-112-log-519
   
   The generated IR is different, but both should be correct. This PR:
   ```
   produce T_divide {
     parallel (ax0.ax1.fused, 0, (tvm_assert_bound(n0, 0, 
n0)*tvm_assert_bound(n1, 0, n1))) {
       for (ax2, 0, tvm_assert_bound(n2, 0, n2)) {
         for (ax3, 0, tvm_assert_bound(n3, 0, n3)) {
           if (((ax0.ax1.fused/tvm_assert_bound(n1, 0, n1)) < 
tvm_assert_bound(n0, 0, n0))) {
             if ((0 <= (ax0.ax1.fused % tvm_assert_bound(n1, 0, n1)))) {
               if (((ax0.ax1.fused % tvm_assert_bound(n1, 0, n1)) < 
tvm_assert_bound(n1, 0, n1))) {
                 T_divide[(((((ax0.ax1.fused/tvm_assert_bound(n1, 0, 
n1))*stride) + ((ax0.ax1.fused % tvm_assert_bound(n1, 0, n1))*stride)) + 
(ax2*stride)) + (ax3*stride))] = (A[(((((ax0.ax1.fused/tvm_assert_bound(n1, 0, 
n1))*stride) + ((ax0.ax1.fused % tvm_assert_bound(n1, 0, n1))*stride)) + 
(ax2*stride)) + (ax3*stride))]/float32(k))
               }
             }
           }
         }
       }
     }
   }
   ```
   
   previously:
   ```
   produce T_divide {
     parallel (ax0.ax1.fused, 0, (n0*n1)) {
       for (ax2, 0, n2) {
         for (ax3, 0, n3) {
           if ((0 <= select((((n1 >= 0) && ((ax0.ax1.fused % n1) >= 0)) || ((n1 
< 0) && ((ax0.ax1.fused % n1) <= 0))), (ax0.ax1.fused/n1), ((ax0.ax1.fused/n1) 
- 1)))) {
             if ((select((((n1 >= 0) && ((ax0.ax1.fused % n1) >= 0)) || ((n1 < 
0) && ((ax0.ax1.fused % n1) <= 0))), (ax0.ax1.fused/n1), ((ax0.ax1.fused/n1) - 
1)) < n0)) {
               if ((0 <= select((((n1 >= 0) && ((ax0.ax1.fused % n1) >= 0)) || 
((n1 < 0) && ((ax0.ax1.fused % n1) <= 0))), (ax0.ax1.fused % n1), 
((ax0.ax1.fused % n1) + n1)))) {
                 if ((select((((n1 >= 0) && ((ax0.ax1.fused % n1) >= 0)) || 
((n1 < 0) && ((ax0.ax1.fused % n1) <= 0))), (ax0.ax1.fused % n1), 
((ax0.ax1.fused % n1) + n1)) < n1)) {
                   T_divide[((((select((((n1 >= 0) && ((ax0.ax1.fused % n1) >= 
0)) || ((n1 < 0) && ((ax0.ax1.fused % n1) <= 0))), (ax0.ax1.fused/n1), 
((ax0.ax1.fused/n1) - 1))*stride) + (select((((n1 >= 0) && ((ax0.ax1.fused % 
n1) >= 0)) || ((n1 < 0) && ((ax0.ax1.fused % n1) <= 0))), (ax0.ax1.fused % n1), 
((ax0.ax1.fused % n1) + n1))*stride)) + (ax2*stride)) + (ax3*stride))] = 
(A[((((select((((n1 >= 0) && ((ax0.ax1.fused % n1) >= 0)) || ((n1 < 0) && 
((ax0.ax1.fused % n1) <= 0))), (ax0.ax1.fused/n1), ((ax0.ax1.fused/n1) - 
1))*stride) + (select((((n1 >= 0) && ((ax0.ax1.fused % n1) >= 0)) || ((n1 < 0) 
&& ((ax0.ax1.fused % n1) <= 0))), (ax0.ax1.fused % n1), ((ax0.ax1.fused % n1) + 
n1))*stride)) + (ax2*stride)) + (ax3*stride))]/float32(k))
                 }
               }
             }
           }
         }
       }
     }
   }
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to