-
Notifications
You must be signed in to change notification settings - Fork 32.6k
protect tensor parallel usage #34800
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,11 +20,6 @@ | |
| from packaging import version | ||
| from safetensors.torch import storage_ptr, storage_size | ||
| from torch import nn | ||
| from torch.distributed.tensor import Replicate | ||
| from torch.distributed.tensor.parallel import ( | ||
| ColwiseParallel, | ||
| RowwiseParallel, | ||
| ) | ||
|
|
||
| from .utils import is_torch_xla_available, logging | ||
|
|
||
|
|
@@ -44,6 +39,14 @@ | |
| is_torch_greater_or_equal_than_1_12 = parsed_torch_version_base >= version.parse("1.12") | ||
|
|
||
|
|
||
| if is_torch_greater_or_equal_than_2_4: | ||
| from torch.distributed.tensor import Replicate | ||
| from torch.distributed.tensor.parallel import ( | ||
| ColwiseParallel, | ||
| RowwiseParallel, | ||
| ) | ||
|
Comment on lines
+42
to
+47
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, Thus it seems there are two options: Option 2:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
|
|
||
| def softmax_backward_data(parent, grad_output, output, dim, self): | ||
| """ | ||
| A function that calls the internal `_softmax_backward_data` PyTorch method and that adjusts the arguments according | ||
|
|
||
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.
Hi @ArthurZucker - this mismatch between the torch 2.4 check and 2.5 requirement means that torch 2.4 still hits this issue (where torch 2.3 is now working properly)