related pr: https://github.com/apache/tvm/pull/18319

But I think we should have a further discussion, because some of the 
constant‑folding and algebraic rewrites may also introduce similar issues. 
Examples include:

- `(x * c1) * c2 → x * (c1 * c2)`
- `(x / c1) / c2 → x / (c1 * c2)` (with correct division semantics)  
- `(x * c1) / c2` simplified if `c1` divisible by `c2`, or vice versa.
- `(x / c1) + c2` normalized into a single division when possible.
- `(y + z) * x → y * x + z * x`  
- `(x + c1) * c2 → x * c2 + c1 * c2`
- `y*x + z*x → (y+z) * x`


However, these rewrites are important for optimization and performance, I think 
we should consider introducing a deterministic switch or similar option that 
can disable these transformations when strict, this pr should be closed.





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/discuss-is-constant-division-to-multiplication-rewrite-in-tvm-necessary/18615/4)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/abfb2dd5d2f3d7b08146976b032d689228f46ff19578ec67ccdc1013fda682dd).

Reply via email to