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

[MPS] Fix type casting copy with storage offset #95573

Closed
wants to merge 2 commits into from

Conversation

qqaatw
Copy link
Collaborator

@qqaatw qqaatw commented Feb 26, 2023

This PR handles the case where the dst tensor of type casting has a storage offset by creating a temporary buffer to store results and then copy them back to the dst with the offset added.

Fixes #95417

@pytorch-bot pytorch-bot bot added ciflow/mps Run MPS tests (subset of trunk) release notes: mps Release notes category labels Feb 26, 2023
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 26, 2023

🔗 Helpful Links

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

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

⏳ No Failures, 1 Pending

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

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

@ezyang ezyang added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Feb 27, 2023
@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 27, 2023
@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

@qqaatw
Copy link
Collaborator Author

qqaatw commented Feb 27, 2023

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: New commits were pushed while merging. Please rerun the merge command.

Details for Dev Infra team Raised by workflow job

@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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: windows-binary-libtorch-release / libtorch-cpu-shared-with-deps-release-test

Details for Dev Infra team Raised by workflow job

@kulinseth
Copy link
Collaborator

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a rebase job. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased fix_type_casting_offset_mm onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout fix_type_casting_offset_mm && git pull --rebase)

@kulinseth
Copy link
Collaborator

@pytorchbot merge -f "All tests are green."

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes).

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

cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 2, 2023
This PR handles the case where the `dst` tensor of type casting has a storage offset by creating a temporary buffer to store results and then copy them back to the dst with the offset added.

Fixes #95417

Pull Request resolved: pytorch/pytorch#95573
Approved by: https://github.com/kulinseth
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 5, 2023
This PR handles the case where the `dst` tensor of type casting has a storage offset by creating a temporary buffer to store results and then copy them back to the dst with the offset added.

Fixes #95417

Pull Request resolved: pytorch/pytorch#95573
Approved by: https://github.com/kulinseth
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 5, 2023
This PR handles the case where the `dst` tensor of type casting has a storage offset by creating a temporary buffer to store results and then copy them back to the dst with the offset added.

Fixes #95417

Pull Request resolved: pytorch/pytorch#95573
Approved by: https://github.com/kulinseth
@ezyang ezyang added this to the 2.0.1 milestone Mar 21, 2023
@atalman atalman removed this from the 2.0.1 milestone Mar 21, 2023
@atalman
Copy link
Contributor

atalman commented Mar 21, 2023

this regression existed in 1.13.1 hence not qualified for 2.0.1 release

@hchau630
Copy link

@atalman sorry if it's a dumb question since I don't really know how release cycles for pytorch works, but doesn't this fit under the category 2: 'Low risk critical fixes for silent correctness'?

@qqaatw
Copy link
Collaborator Author

qqaatw commented Mar 30, 2023

If qualified I can send a PR against the release branch.

hchau630 pushed a commit to hchau630/pytorch that referenced this pull request Apr 10, 2023
This PR handles the case where the `dst` tensor of type casting has a storage offset by creating a temporary buffer to store results and then copy them back to the dst with the offset added.

Fixes pytorch#95417

Pull Request resolved: pytorch#95573
Approved by: https://github.com/kulinseth
pruthvistony added a commit to ROCm/pytorch that referenced this pull request May 2, 2023
@atalman atalman modified the milestone: 2.0.1 May 3, 2023
jhavukainen pushed a commit to kulinseth/pytorch that referenced this pull request Mar 15, 2024
This PR handles the case where the `dst` tensor of type casting has a storage offset by creating a temporary buffer to store results and then copy them back to the dst with the offset added.

Fixes pytorch#95417

Pull Request resolved: pytorch#95573
Approved by: https://github.com/kulinseth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/mps Run MPS tests (subset of trunk) ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: mps Release notes category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tensor __setitem__ incorrect on mps when dtypes mismatch
7 participants