Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IntSet] Avoid overly pessimizing while recursively evaluating bounds #3773

Conversation

ajtulloch
Copy link
Contributor

Proposed solution for (part of) #3770.

This doesn't solve the whole problem but helps a bit in some cases. I would much prefer a better solution, possibly the one in ajtulloch@ca1088c.

Reproduction:

import tvm

n = tvm.var('n')
X = tvm.placeholder(shape=(n,), name="x")
W = tvm.placeholder(shape=(n + 1,), dtype="int32", name="w")

def f(i):
    start = W[i]
    extent = W[i+1] - W[i]
    rv = tvm.reduce_axis((0, extent))
    return tvm.sum(X[rv + start], axis=rv)
Y = tvm.compute(X.shape, f, name="y")
s = tvm.create_schedule([Y.op])
print(tvm.lower(s, [X, W, Y], simple_mode=True))

Before:

produce y {
  for (i, 0, n) {
    y[i] = 0f
    for (rv, 0, (w[(i + 1)] - w[i])) {
      if ((rv < (w[(i + 1)] - w[i]))) {
        y[i] = (y[i] + x[(rv + w[i])])
      }
    }
  }
}

After:

produce y {
  for (i, 0, n) {
    y[i] = 0.000000f
    for (rv, 0, (w[(i + 1)] - w[i])) {
      y[i] = (y[i] + x[(w[i] + rv)])
    }
  }
}

@jroesch jroesch added status: need review status: need update need update based on feedbacks labels Sep 1, 2019
@tqchen
Copy link
Member

tqchen commented Oct 10, 2019

Superceded by #4076

@tqchen tqchen removed status: need review status: need update need update based on feedbacks labels Oct 10, 2019
@tqchen tqchen closed this Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants