tqchen commented on code in PR #14511:
URL: https://github.com/apache/tvm/pull/14511#discussion_r1158840469


##########
src/relax/transform/static_plan_block_memory.cc:
##########
@@ -401,8 +431,23 @@ class StorageAllocatorInit : public 
StorageAllocatorBaseVisitor {
     ICHECK(sinfo->dtype == Downcast<DataTypeImm>(call->args[1])->value);
     ICHECK(!token_map_.count(call));
 
-    // No support for symbolic shape at this moment.
+    // Use the upper bounds of TIR vars as their values.
+    Array<PrimExpr> upper_bounded_shape;
+    upper_bounded_shape.reserve(shape->values.size());
     for (const PrimExpr& dim_len : shape->values) {
+      upper_bounded_shape.push_back(
+          ana_.Simplify(tir::Substitute(dim_len, [this](const tir::Var& v) -> 
tvm::PrimExpr {

Review Comment:
   Do not use substitute, instead use ConstIntBound. see 
https://github.com/apache/tvm/blob/main/include/tvm/arith/analyzer.h#L131, this 
helps to avoid cases where expression is not monotonically increasing with the 
var



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to