This is happening because of a typo in line 366 below https://github.com/dmlc/tvm/blob/0806b69e3fb136226fa1dafad00bd2c606cc998d/src/arithmetic/canonical.cc#L356-L366 Instead of mod-ing the two operands, they are being multiplied.