You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "junrushao (via GitHub)" <gi...@apache.org> on 2023/09/07 22:39:33 UTC

[GitHub] [tvm] junrushao commented on a diff in pull request #15680: [Disco][Op] scatter_from_worker0

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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org