Closed
Conversation
Signed-off-by: tdophung <tdophung@nvidia.com>
…ging_probs booleans. Implement partitioning for all permutation primitives Signed-off-by: tdophung <tdophung@nvidia.com>
Signed-off-by: tdophung <tdophung@nvidia.com>
…ernel zero intiialize output permuted scales, permuted probs and output tokens Signed-off-by: tdophung <tdophung@nvidia.com>
for more information, see https://pre-commit.ci
…tead, add extra input (aliased wiuth output) buffer to inner primitive of permutation on jax side to pass in zero intitiated buffers done with jnp zeros Signed-off-by: tdophung <tdophung@nvidia.com>
Signed-off-by: tdophung <tdophung@nvidia.com>
…s in utils Signed-off-by: tdophung <tdophung@nvidia.com>
…/TransformerEngine into custom_partitioning_permutation
for more information, see https://pre-commit.ci
Signed-off-by: tdophung <tdophung@nvidia.com>
…/TransformerEngine into custom_partitioning_permutation
for more information, see https://pre-commit.ci
Signed-off-by: tdophung <tdophung@nvidia.com>
…/TransformerEngine into custom_partitioning_permutation
Signed-off-by: tdophung <tdophung@nvidia.com>
Signed-off-by: tdophung <tdophung@nvidia.com>
Contributor
Greptile Summary
Important Files Changed
Confidence score: 2/5
|
| ) | ||
| ) | ||
| return output, permuted_probs, row_id_map, pad_offsets, target_tokens_per_expert | ||
| return output, permuted_probs, row_id_map, pad_offsets, out_tokens_per_expert |
Contributor
There was a problem hiding this comment.
syntax: out_tokens_per_expert is undefined - should be target_tokens_per_expert
Suggested change
| return output, permuted_probs, row_id_map, pad_offsets, out_tokens_per_expert | |
| return output, permuted_probs, row_id_map, pad_offsets, target_tokens_per_expert |
Collaborator
Author
|
Opened this on the wrong branch. Closing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
To enable expert parallelism in MOE, we need to perform a ragged all-to-all after permutation to rearrange the permuted tokens (grouped by experts) onto all GPUs such that each GPU only store a subset of the experts. Ragged all-to-all is used because the number of tokens per expert is most often times, not the same between experts. To do this ragged all-to-all operation, we need to provide it with arguments specifying the number of tokens_per_expert, or often called group sizes in maxText.
In this PR, we compute these group sizes as part of the permutation operation and return them by default
#2585
#2536
Type of change
Changes
return tokens_per_expert by default from summing up expert columns in routing map.
Checklist: