yelite commented on code in PR #15028:
URL: https://github.com/apache/tvm/pull/15028#discussion_r1219886379
##########
python/tvm/relax/backend/contrib/cutlass.py:
##########
@@ -412,6 +412,10 @@ def visit_function_(self, f):
out_size_1d = _shape_1d(f.ret_struct_info.shape)
# This needs to be in sync with the actual value that the kernel
expects.
workspace_size_bytes = out_size_1d * {"float16": 2, "float32":
4}[out_dtype]
+ if not isinstance(workspace_size_bytes, (int,
tvm.tir.expr.IntImm)):
+ # Tempororay workaround for dynamic shape workload. Will be
removed when
+ # workspace for dynamic shape workload is implemented.
+ workspace_size_bytes = 8
Review Comment:
The approach in my mind is to make the `max_workspace_size_` of
`WorkspaceProvider` a `PrimExpr` isntead of `IntImm`, which consists of a
series of `max` expr to get the actual max workspace size from symbolic shape
variables.
I tried to doing this in the most straightforward way and got `This IR is
not well formed: Symbolic Var a presents in different functions in the same
Module.`. Apparently it needs more sophisticated analysis to replace the shape
variables with valid ones as the workspace size is propagated from composite
function to its caller. Also I am not sure if the arg of `alloc_tensor` can be
a non-constant expr too.
--
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]