-
Notifications
You must be signed in to change notification settings - Fork 112
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
[RFC] Add collective_broadcast to the StableHLO specification #1809
[RFC] Add collective_broadcast to the StableHLO specification #1809
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Also - could you follow this link and sign the CLA when you get a chance. |
I work at Nvidia so I need to go through the separate channel. I'll take care of it don't worry. |
58152f9
to
1fd801a
Compare
1fd801a
to
059d932
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made updates based on the new semantics.
Thank you for the RFC. The current set of collective operations are currently used in the SPMD context, where each device is running the same program. With the proposed collective_broadcast, do you have an MPMD use case for this, or were you expecting other devices which were not broadcasting to produce an empty buffer as a result of the broadcast? |
No, the idea is for this to still be targeting exclusively SPMD. On the cuda side, the goal is to have this op lower to the exact same |
To give a very concrete example of how this operation could be used in a realistic SPMD setting, let me show you some code. Here, we have an example of how we could implement the 2D pgemm algorithm summa in JAX once this spec is in place. @partial(shard_map, mesh=Mesh(...),
in_specs=(P('x', 'y'), P('x', 'y')), out_specs=P('x', 'y'))
def summa_matrix_multiply(a, b):
for i in range(N):
abcast = pcollective_broadcast(a, 'y', root=i)
bbcast = pcollective_broadcast(b, 'x', root=i)
if i == 0:
c = abcast @ bbcast
c += abcast @ bbcast
return c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RFC Approved. I'll send a follow-up with markdownlint fixes.
🥳 🎉 Thanks again Kevin for getting this over the finish line! I'll get to work on getting this implemented in JAX and cuda xla backend. |
This RFC proposes adding
collective_broadcast
as one of the collective communication primitives.Please provide any feedback you feel is valuable.