junrushao commented on code in PR #15680:
URL: https://github.com/apache/tvm/pull/15680#discussion_r1319179762


##########
python/tvm/relax/transform/legalize_ops/ccl.py:
##########
@@ -46,9 +48,34 @@ def _allreduce(_bb: BlockBuilder, call: Call) -> Expr:
 
 
 @register_legalize("relax.ccl.broadcast_from_worker0")
-def broadcast_from_worker0(_bb: BlockBuilder, call: Call) -> Expr:
+def _broadcast_from_worker0(_bb: BlockBuilder, call: Call) -> Expr:
     return call_pure_packed(
         "runtime.disco.broadcast_from_worker0",
         call.args[0],
         sinfo_args=call.args[0].struct_info,
     )
+
+
+@register_legalize("relax.ccl.scatter_from_worker0")
+def _scatter_from_worker0(_bb: BlockBuilder, call: Call) -> Expr:
+    output_shape = []
+    for i, shape_value in enumerate(call.args[0].struct_info.shape.values):

Review Comment:
   ```python
   assert isinstance(call.args[0].struct_info, TensorStructInfo)
   assert isinstance(call.args[0].struct_info.shape.struct_info, 
ShapeStructInfo)
   arg_shape = call.args[0].struct_info.shape.struct_info
   ```



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