[DISCUSS] Embed more Bound Information into Var or Expr


I think option B puts too much limitation that it might be only good for asserting non-neg property. But I can imagine that we need more properties on shapes to perform other optimization. At that time, we will be back on this discussion again whether we add another intrinsic or we will add property to var. For example, people may want to add likely property to a var that expresses the likely size of a shape as a hint to AutoTVM. Allowing var to have properties will benefit in long term, IMO.

I agree with @kparzysz that having such builtin_condition or other helper function for developers to easily add properties to var is good for usability.


Let me try to summarize the point. Seems we are converging to a common ground.

I think currently the closest thing possible would be add an assert_expr that assets the non-negative condition to the expression as well as other conditions(chained by and). Alternatively, we can go for the assert_lower_bound, which is more specialized.

assert_expr(x, x>=0)

@haichen would you like to volunteer to summarize, send a formal RFC and land this feature? It would be relevant to dynamic shapes


Sure, I’ll follow up with a RFC.


another potential use case: https://github.com/dmlc/tvm/pull/3842#discussion_r319835313