-
Notifications
You must be signed in to change notification settings - Fork 505
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
Add Tensor Parallel to torch_native_llama #1876
base: main
Are you sure you want to change the base?
Conversation
Move tp to utils Add ColwiseParallelSharded
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.
LGTM, I think this is the best we can do for now until we don't use fused qkv and rely on torch.compile for speedup
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.
LGTM. We can merge this soon.
- Can we add a unit test for this? Example: https://github.com/sgl-project/sglang/blob/main/test/srt/test_torchao.py
- Can you fix the lint errors: https://sgl-project.github.io/references/contributor_guide.html#format-your-code
@@ -24,7 +24,10 @@ | |||
from torch import nn |
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.
Add a unit test or at least add some doc strings here on how to run this model?
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.
Thanks for the suggestion. I added a section describing how to run the model with TP.
@merrymercy Thanks much for your review. Was in roadmapping hence the code change was delayed. Thanks for your rebase and would appreciate your review! |
Motivation
The torch_native_llama model does not have Tensor Parallel support today. This PR adds it, using
torch.distributed
APIs.Modifications
.tensor_parallel()
utility;ColwiseParallel
andRowwiseParallel
annotations to related sub-modules;Tests
pytest test/srt/test_torch_tp.py
Checklist
cc: @jerryzh168 @merrymercy @wz337