Skip to content
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

Enable generic dimentionality for input #41

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

vchiley
Copy link
Collaborator

@vchiley vchiley commented Dec 1, 2023

MegaBlocks currently assumes a 3D input [sl, bs, hs] when in fact MegaBlocks should be able to operate on inputs of any multi-dim shape [*, hs]
The changes in this PR enable that.

Useful for padded inputs. If we flatten padded inputs with shape: [sl, bs, hs] into input with shape: [sl * bs - num_pad_tok, hs], then pad tokens are not part of all2all routing and lbl isn't computed on padding tokens.

@vchiley vchiley marked this pull request as ready for review December 1, 2023 23:52
@mvpatel2000 mvpatel2000 requested a review from tgale96 December 2, 2023 00:09
@tgale96 tgale96 merged commit 6e09bc5 into databricks:main Dec 4, 2023
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.

3 participants