This is an automated email from the ASF dual-hosted git repository.

tlopex pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new d33a44702c [Tests] Update test_adaptive_pooling_window expected IR for 
const-int-bound fix (#20023)
d33a44702c is described below

commit d33a44702c23dccb8d9f850032d703f22a35af4a
Author: Syeam Bin Abdullah <[email protected]>
AuthorDate: Sat Jul 18 00:14:25 2026 +0930

    [Tests] Update test_adaptive_pooling_window expected IR for const-int-bound 
fix (#20023)
    
    Followup to #19978: the const-int-bound modular-set fix correctly
    prevents the simplifier from over-folding the adaptive pool window
    extent. The previous expected IR used the simplified closed form `(v_ax2
    % 3 * 4 + 16) // 12 + 1`, which was only reachable because the buggy
    bound let `CanProve` prove an invalid predicate. After the fix the
    generated IR retains the correct `T.Select` form, so update the expected
    IR to match and remove the `xfail` marker that was added in #19978.
    
    This branch is based on current main so the `xfail` removal is explicit
    (addressing feedback from @tlopex on the previous attempt in #19995).
---
 tests/python/te/test_te_create_primfunc.py | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tests/python/te/test_te_create_primfunc.py 
b/tests/python/te/test_te_create_primfunc.py
index e3fd003f31..38eef4f795 100644
--- a/tests/python/te/test_te_create_primfunc.py
+++ b/tests/python/te/test_te_create_primfunc.py
@@ -911,11 +911,6 @@ def test_loop_aware_reducer_combiner():
     _check_workload(te_workload, tir_workload)
 
 
[email protected](
-    reason="const-int-bound fix (apache/tvm#19978) simplifies the adaptive "
-    "pool window extent; the expected IR below still encodes the old "
-    "(pre-fix) T.Select form and needs updating as a followup"
-)
 def test_adaptive_pooling_window():
     @T.prim_func(s_tir=True)
     def tir_workload(
@@ -926,11 +921,11 @@ def test_adaptive_pooling_window():
         # fmt: off
         adaptive_pool_sum = T.sblock_alloc_buffer((1, 1024, 12, 30))
         for ax0, ax1, ax2, ax3 in T.grid(1, 1024, 12, 30):
-            with T.sblock("adaptive_pool_sum_1"):
+            with T.sblock("adaptive_pool_sum_l1"):
                 v_ax0, v_ax1, v_ax2, v_ax3 = T.axis.remap("SSSS", [ax0, ax1, 
ax2, ax3])
                 T.reads(x[v_ax0, v_ax1, v_ax2 * 16 // 12:v_ax2 * 16 // 12 + 
((v_ax2 % 3 * 4 + 16) // 12 + 1), v_ax3 * 40 // 30:v_ax3 * 40 // 30 + ((v_ax3 % 
3 * 10 + 40) // 30 + 1)])
                 T.writes(adaptive_pool_sum[v_ax0, v_ax1, v_ax2, v_ax3])
-                for rv0, rv1 in T.grid((v_ax2 % 3 * 4 + 16) // 12 + 1, (v_ax3 
% 3 * 10 + 40) // 30 + 1):
+                for rv0, rv1 in T.grid(T.Select((v_ax2 * 16 + 4) % 12 == 0, 
(v_ax2 * 16 + 16) // 12, (v_ax2 * 16 + 16) // 12 + 1) - v_ax2 * 16 // 12, 
T.Select((v_ax3 * 40 + 10) % 30 == 0, (v_ax3 * 40 + 40) // 30, (v_ax3 * 40 + 
40) // 30 + 1) - v_ax3 * 40 // 30):
                     with T.sblock("adaptive_pool_sum"):
                         v_ax0_1 = T.axis.spatial((v_ax0, v_ax0 + 1), v_ax0)
                         v_ax1_1 = T.axis.spatial((v_ax1, v_ax1 + 1), v_ax1)
@@ -948,7 +943,7 @@ def test_adaptive_pooling_window():
                 T.reads(adaptive_pool_sum[v_ax0, v_ax1, v_ax2, v_ax3])
                 T.writes(adaptive_pool_avg[v_ax0, v_ax1, v_ax2, v_ax3])
                 T.sblock_attr({"schedule_rule": 
"meta_schedule.adaptive_pool_avg"})
-                adaptive_pool_avg[v_ax0, v_ax1, v_ax2, v_ax3] = 
adaptive_pool_sum[v_ax0, v_ax1, v_ax2, v_ax3] / (T.Cast("float32", (v_ax2 % 3 * 
4 + 16) // 12 + 1) * T.Cast("float32", (v_ax3 % 3 * 10 + 40) // 30 + 1))
+                adaptive_pool_avg[v_ax0, v_ax1, v_ax2, v_ax3] = 
adaptive_pool_sum[v_ax0, v_ax1, v_ax2, v_ax3] / (T.Cast("float32", 
T.Select((v_ax2 * 16 + 4) % 12 == 0, (v_ax2 * 16 + 16) // 12, (v_ax2 * 16 + 16) 
// 12 + 1) - v_ax2 * 16 // 12) * T.Cast("float32", T.Select((v_ax3 * 40 + 10) % 
30 == 0, (v_ax3 * 40 + 40) // 30, (v_ax3 * 40 + 40) // 30 + 1) - v_ax3 * 40 // 
30))
         # fmt: on
 
     def te_workload():

Reply via email to