`PassUpDomain` can also be conservative in some cases. This can be illustrated 
with the following test case.

```
import tvm
import numpy as np

M = 64
N = 64

B = tvm.compute((M, N), lambda i, j: i+j, name='B')
C = tvm.compute(
    (M, N),
    lambda i, j: B[i,j], 
    name='C'
)

s = tvm.create_schedule(C.op)

all = s[C].fuse(C.op.axis[0], C.op.axis[1])
i, j = s[C].split(all, nparts=512)

s[B].compute_at(s[C], i)

print(tvm.lower(s, [C], simple_mode=True))
```

Output 
```
// attr [B] storage_scope = "global"
allocate B[int32 * 4096]
produce C {
  for (i.j.fused.outer, 0, 512) {
    produce B {
      for (i, 0, 64) {
        for (j, 0, 64) {
          B[((i*64) + j)] = (i + j)
        }
      }
    }
    for (i.j.fused.inner, 0, 8) {
      C[((i.j.fused.outer*8) + i.j.fused.inner)] = B[((i.j.fused.outer*8) + 
i.j.fused.inner)]
    }
  }
}
```
Note that whole `B` is realized although it is at the loop `i`, not at the root.

This also affects the Tensorise feature, which uses the same `PassUpDomain()`. 
See the discussion 
[here](https://discuss.tvm.ai/t/tensorize-which-use-case-is-correct/2140/4?u=yuanlin).





---
[Visit 
Topic](https://discuss.tvm.ai/t/discuss-contributing-new-docs-for-inferbound/2151/9)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/0cafcf280eb1c3e42b2a0819e26ebdbde13fffe813de97a244cd3e8d5728f9cc).

Tianqi Chen, UW, Seattle, WA, 98105, United States
http://tracking.discuss.tvm.ai/tracking/unsubscribe?msgid=FFulO36TMFrUPXRm5470Sg2

Reply via email to