question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incomplete shceduling for "where"

See original GitHub issue

I was trying TVM IR with the following simple computation pattern that creates a set of reference data ref to filter the computation at the next stage. Here is the code I used:

N = tvm.var('N')
V = tvm.var('V')

data = tvm.placeholder((N,V), name='data')
rv = tvm.reduce_axis((0, N), name='rv')

ref  = tvm.compute((N,), lambda n: data[n, 0], name='ref')
masked_data = tvm.compute((N,),
        lambda n: tvm.sum(data[n, rv], rv, ref[rv] == 1),
        name='masked_data')

s = tvm.create_schedule(masked_data.op)
print(tvm.lower(s, [data, ref, masked_data], simple_mode=True))

The output from lower is shown below:

produce masked_data {
  for (n, 0, N) {
    masked_data[n] = 0.000000f
    for (rv, 0, N) {
      if ((ref[rv] == 1.000000f)) {
        masked_data[n] = (masked_data[n] + data[((n*V) + rv)])
      }
    }
  }
}

As can be seen, the computation for ref was missing. Did I misunderstand anything of using TVM IR?

p.s. I know this piece of code looks silly since we can achieve the same functionality without creating ref. On the other hand, this is just the simplified code example to illustrate the problem I’m encountering.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
merrymercycommented, Dec 19, 2017

I think it is a bug. if you put ref in the body of tvm.sum, tvm can detect the dependency. But it fails when ref is in the condition.

0reactions
comaniaccommented, Dec 22, 2017

Sure I’ll take a close look later on, since I have other plans during the Christmas.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Daily Scheduling: How Do You Deal With Incomplete Work?
In maintenance planning and scheduling, if all work was completed as scheduled, we'd never have to deal with roll over work.
Read more >
Three Strategies To Deal With Incomplete Data In Production ...
Three Strategies To Deal With Incomplete Data In Production Scheduling · #1 Schedule, not optimize · #2 Simplify, not complicate · #3 Focus...
Read more >
Construction Scheduling. Progress Updates and Incomplete ...
If the Progress Update results in a late Finish Date for the project, then we have some work to do. This is, more...
Read more >
Coping with Incomplete Information in Scheduling
Our work is devoted to investigations on how to cope with incomplete information when solving scheduling problems. The particular problem class we consider ......
Read more >
(PDF) Coping with Incomplete Information in Scheduling
PDF | On Jan 1, 2006, Nicole Megow published Coping with Incomplete Information in Scheduling | Find, read and cite all the research...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found