Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Relax] Add new NN allgather operator #17359

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions python/tvm/relax/frontend/nn/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,28 @@ def ccl_allreduce(x: Tensor, op_type: str = "sum", in_group: bool = True, name="
return wrap_nested(_op.ccl.allreduce(x._expr, op_type, in_group), name)


def ccl_allgather(x: Tensor, num_workers: int, name="ccl_allgather"):
"""CCL Allgather operator

Parameters
----------
x : relax.Expr
The input tensor.

num_workers : int
Number of workers.

name : str
Name hint for this operation.

Returns
-------
result : Tensor
The result tensor of allgather.
"""
return wrap_nested(_op.ccl.allgather(x._expr, num_workers), name)


def ccl_broadcast_from_worker0(x: Tensor, name="broadcast_from_worker"):
"""Broadcast data from worker-0 to all other workers.

Expand Down
Loading