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

Check inputs have same dtype in addmm_impl_cpu_ even if input has zero numel #100274

Closed
wants to merge 2 commits into from

Conversation

soulitzer
Copy link
Contributor

@soulitzer soulitzer commented Apr 28, 2023

Stack from ghstack (oldest at bottom):

Fixes #99226

When an inputs has zero numel, addmm_impl_cpu_'s check that the inputs have the same dtype are bypassed. This PR adds a check before the early return.

@pytorch-bot
Copy link

pytorch-bot bot commented Apr 28, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit ad898d7:
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added release notes: linalg_frontend release notes category labels Apr 28, 2023
soulitzer added a commit that referenced this pull request Apr 28, 2023
ghstack-source-id: 2c869e722d1f975bc80ddaa862f8fdc64ca60690
Pull Request resolved: #100274
@soulitzer soulitzer requested a review from albanD April 28, 2023 20:29
@soulitzer soulitzer changed the title Check dtype in addmm_impl_cpu_ even if input has zero numel Check inputs have same dtype in addmm_impl_cpu_ even if input has zero numel Apr 28, 2023
…put has zero numel"


Fixes #99226

When an inputs has zero numel, addmm_impl_cpu_'s check that the inputs have the same dtype are bypassed. This PR adds a check before  the early return.

[ghstack-poisoned]
soulitzer added a commit that referenced this pull request Apr 28, 2023
ghstack-source-id: 6ba072d6a24cebc866c60030669a07af4a8752eb
Pull Request resolved: #100274
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

I don't know what the expectation for our type promotion is here. In particular, are there (non zero size) cases where this used to work as we were ok with type promotion but this PR now raises an error?

cc @ngimel

@ngimel
Copy link
Collaborator

ngimel commented Apr 28, 2023

Nah that's fine, even if there were (e.g. alpha=0) we could error out.

@soulitzer soulitzer added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 28, 2023
@soulitzer
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@IvanYashchuk IvanYashchuk removed their request for review May 2, 2023 05:56
soulitzer added a commit to soulitzer/pytorch that referenced this pull request May 2, 2023
… build failures

Summary:
This diff is reverting D45446149
D45446149: Check inputs have same dtype in addmm_impl_cpu_ even if input has zero numel (pytorch#100274) by soulitzer has been identified to be causing the following test or build failures:

Tests affected:
- [caffe2/torch/fb/model_transform/splitting/tests:utils_test - test_maybe_fix_dtype_errors (caffe2.torch.fb.model_transform.splitting.tests.utils_test.UtilsTest)](https://www.internalfb.com/intern/test/844425018399076/)

Here's the Multisect link:
https://www.internalfb.com/multisect/1972447
Here are the tasks that are relevant to this breakage:

We're generating a revert to back out the changes in this diff, please note the backout may land if someone accepts it.

If you believe this diff has been generated in error you may Commandeer and Abandon it.

Test Plan: NA

Reviewed By: soulitzer

Differential Revision: D45471651

fbshipit-source-id: 8440285bfe4a4fcb808da74663ff818478b9b8e0
@facebook-github-bot facebook-github-bot deleted the gh/soulitzer/202/head branch June 8, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged merging release notes: linalg_frontend release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants