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

Support qmatmul with different dims tensors #4438

Closed
wants to merge 1 commit into from

Conversation

mcremon-meta
Copy link
Contributor

Summary:
MobileBERT exposes an issue in our kernel, where tensors have compatible (for PyTorch) but different batch dimensions.

This diff changes the meta kernel to support that (the kernel can already do it).

Differential Revision: D60314979

Copy link

pytorch-bot bot commented Jul 26, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4438

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 1087859 with merge base 1e4603d (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 26, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60314979

Comment on lines +208 to +213
# Combine the larger batch dimensions with the matmul output size
out_size = (
X_batch_dims + mat_size
if len(X_batch_dims) > len(Y_batch_dims)
else Y_batch_dims + mat_size
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why combine the larger of the two batch dims? Perhaps it should just default to the first argument's instead?
This would seem like unpredictable behavior to someone using this function.

Summary:
Pull Request resolved: #4438

MobileBERT exposes an issue in our kernel, where tensors have compatible (for PyTorch) but different batch dimensions.

This diff changes the meta kernel to support that (the kernel can already do it).

Reviewed By: dulinriley

Differential Revision: D60314979
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60314979

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in f695f8e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants