Conversation
src/liger_kernel/ops/swiglu.py
Outdated
| @staticmethod | ||
| @ensure_contiguous | ||
| def forward(ctx, a, b): | ||
| if isinstance(a, torch.distributed.tensor.DTensor): |
Collaborator
There was a problem hiding this comment.
Can we also add a check for b? to make sure that a and mb are not incompatible?
Collaborator
Author
There was a problem hiding this comment.
Added handling for case where the inputs are mixed regular and D-tensors.
| " float key.dtype: c10::BFloat16 and value.dtype: c10::BFloat16 instead." | ||
| ) | ||
| ), | ||
| # pytest.mark.xfail( |
Collaborator
There was a problem hiding this comment.
need to uncomment it
Collaborator
Author
There was a problem hiding this comment.
Actually it was commented originally. make checkstyle added a space to make it pass the formatting checks.
f38a1d2 to
d7fbcc9
Compare
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.
Summary
D tensor support for swiglu. All computations are performed element wise with the local tensors and the output tensor distributed layout is mirrored from the inputs.
Testing Done
Tested with 4 and 8 H100 GPUs locally using NCCL as the communication backend.
make testto ensure correctnessmake checkstyleto ensure code stylemake test-convergenceto ensure convergence