OmarAzizi commented on code in PR #20243:
URL: https://github.com/apache/tvm/pull/20243#discussion_r3918852572


##########
src/relax/transform/combine_parallel_matmul.cc:
##########
@@ -210,6 +217,25 @@ ffi::TypedFunction<ffi::Map<Var, Expr>(ffi::Map<DFPattern, 
Var>, ffi::Map<Var, E
         continue;
       }
 
+      if (branch_info.bias_dim) {
+        std::vector<ffi::Array<PrimExpr>> bias_shapes;
+        bool bias_shape_unknown = false;
+        for (const auto& bias_var : bias) {
+          auto bias_shape_opt = GetTensorType(bias_var)->GetShape();
+          if (!bias_shape_opt) {
+            bias_shape_unknown = true;
+            break;
+          }
+          bias_shapes.push_back(bias_shape_opt.value());
+        }
+        if (bias_shape_unknown) {
+          return ffi::Map<Var, Expr>{};
+        }
+        if (!shapes_compatible_excluding_trailing_axes(bias_shapes, 1)) {

Review Comment:
   Done, I added the check and a new regression test in a c67ceca.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to