Re: [dmlc/tvm] [RFC][ARITH] Introduce FloorDiv/Mod for Context-Independent Simplifications (#3478)

2019-07-05 Thread Salem Derisavi
Not sure whether the decision has already been done but I'll put my two cents here. You have covered all the tradeoffs. Since in most cases, the divisor is positive, I believe the important move was to add one of floordiv or euclideandiv (which you are doing now). The difference between floordi

[TVM Discuss] [Development] Integer constant folding for division and mod

2019-03-25 Thread Salem Derisavi via TVM Discuss
Is there a way to enable the new infra (and disable the old one) to be able to evaluate it, for example, for unit testcases, bugs we encounter in customized forks of TVM, etc.? --- [Visit Topic](https://discuss.tvm.ai/t/integer-constant-folding-for-division-and-mod/2008/9) to respond. Y

[TVM Discuss] [Development] Integer constant folding for division and mod

2019-03-25 Thread Salem Derisavi via TVM Discuss
You're right. I just checked those specific rules in the new infra and they were fixed. I had mistakenly assumed that the rules of the new infra were copied from the old infra without further changes. On an orthogonal but related topic: I believe it's still important to fix bugs in old relea

[TVM Discuss] [Development] Integer constant folding for division and mod

2019-03-25 Thread Salem Derisavi via TVM Discuss
The investigation I'm doing will affect both the old and new infra. So far I have found out that we currently have simplification rules that are not correct. For example, we simplify (x*4 + y) / 2 to x*2 + y/2 which is not correct in general but is true if we prove that x*4+y and y are both n

[TVM Discuss] [Development] Integer constant folding for division and mod

2019-03-25 Thread Salem Derisavi via TVM Discuss
I tried the fix but a few TVM testcases started to fail. I think those testcases were assuming that division was Euclidean and that's why they were passing before. I need more time to investigate and fix them. --- [Visit Topic](https://discuss.tvm.ai/t/integer-constant-folding-for-divisio

[TVM Discuss] [Development] Integer constant folding for division and mod

2019-03-25 Thread Salem Derisavi via TVM Discuss
I think `div_imp` should simply return `a/b` --- [Visit Topic](https://discuss.tvm.ai/t/integer-constant-folding-for-division-and-mod/2008/2) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails, [click here](https://discuss.tvm.ai/e

[TVM Discuss] [Development] Integer constant folding for division and mod

2019-03-25 Thread Salem Derisavi via TVM Discuss
@sgrechanik-h @tqchen @yzhliu My understanding is that TVM uses truncated division/mod, unlike Halide that uses Euclidean division/mod. Nevertheless, TVM uses `div_imp` (imlementation below) to do constant folding for division. Seems like this implementation is coming from Halide source code.