Skip to content

Kolehma8/dist swiglu#1129

Merged
kolehma8 merged 3 commits intomainfrom
kolehma8/dist_swiglu
Mar 5, 2026
Merged

Kolehma8/dist swiglu#1129
kolehma8 merged 3 commits intomainfrom
kolehma8/dist_swiglu

Conversation

@kolehma8
Copy link
Collaborator

@kolehma8 kolehma8 commented Mar 4, 2026

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.

  • Hardware Type:
  • run make test to ensure correctness
  • run make checkstyle to ensure code style
  • run make test-convergence to ensure convergence

@staticmethod
@ensure_contiguous
def forward(ctx, a, b):
if isinstance(a, torch.distributed.tensor.DTensor):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a check for b? to make sure that a and mb are not incompatible?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to uncomment it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it was commented originally. make checkstyle added a space to make it pass the formatting checks.

@kolehma8 kolehma8 force-pushed the kolehma8/dist_swiglu branch from f38a1d2 to d7fbcc9 Compare March 5, 2026 23:12
@kolehma8 kolehma8 requested a review from vaibhavjindal March 5, 2026 23:13
Copy link
Collaborator

@vaibhavjindal vaibhavjindal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kolehma8 kolehma8 added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit adb2238 Mar 5, 2026
5 of 7 checks passed
@kolehma8 kolehma8 deleted the kolehma8/dist_swiglu branch March 5, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants