I’ve been having difficulty applying threads to a compute schedule I’m working with.
Looking at the generated IR, there could be an issue there.
There are two statements that should be evaluated to a constant. however they are left unsimplified.
With an outer loop nc in the range 0, 128, we have two expressions:
(((floordiv(((floordiv(nc, 32)*8) + 7), 16)*64) + 64) - (floordiv(nc, 64)*64))
((floordiv(((floordiv(nc, 32)*8) + 7), 16) + 1) - floordiv(nc, 64))
These should always evaluate to 64 and 1 respectively.
#(((floordiv(((floordiv(nc, 32)*8) + 7), 16)*64) + 64) - (floordiv(nc, 64)*64))
for nc in range(128):
value = ((nc // 32) * 8 + 7)
value = value // 16
value *= 64
value += 64
value2 = (nc // 64) * 64
print(nc, ':\t\t', value - value2)
print('next statement:')
# (floordiv(((floordiv(nc, 32)*8) + 7), 16) + 1) - floordiv(nc, 64))
for nc in range(128):
value = ((nc // 32) * 8) + 7
value = value // 16
value += 1
value2 = nc // 64
print(nc, ':\t\t', value - value2)
I’m trying to find a simpler compute and schedule to reproduce this problem.
However, in the meantime, is there obvious reason why these two expressions would not be simplified?
Any pointers in where in the tvm codebase I could start tracing this?