8000 [draft_export] fix dense-in-memory check for inferring fakes by pianpwk · Pull Request #145653 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[draft_export] fix dense-in-memory check for inferring fakes #145653

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

Closed
wants to merge 1 commit into from

Conversation

pianpwk
Copy link
Contributor
@pianpwk pianpwk commented Jan 24, 2025

Test Plan: fixes check for dense tensors with size-1 dimensions

Differential Revision: D68644028

Summary: fixes the dense-in-memory check so it doesn't fail on output sizes like `[80, 1, 4]`. more details in the inline comment

Test Plan: test_draft_export

Differential Revision: D68644028
Copy link
pytorch-bot bot commented Jan 24, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 653a2aa with merge base d79c6f4 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@facebook-github-bot
Copy link
Contributor

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

@@ -2833,7 +2833,7 @@ def unsupported(reason: str) -> None:
# We went with the first option.
fake_strides = [-1] * real_out.dim()
strides = [(s, idx) for idx, s in enumerate(real_out.stride())]
strides.sort()
strides.sort(key=lambda x: (x[0], -x[1]))
Copy link
Contributor Author
@pianpwk pianpwk Jan 24, 2025

Choose a reason for hiding this comment

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

For an input like [80, 1, 4], this was previously [(1, 2), (4, 0), (4,1)], which meant once we processed dim 1, the expected stride is 420 (instead of 80). The fix just sorts dimensions in reverse to avoid this when some dim has shape 1.

@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 24, 2025 21:36 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 24, 2025 21:36 Inactive
@pianpwk pianpwk requested review from zou3519 and angelayi January 24, 2025 23:20
Copy link
Contributor
@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

nice catch

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 27, 2025
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 27, 2025 21:55 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 27, 2025 21:55 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 27, 2025 21:55 Inactive
@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@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

@github-actions github-actions bot deleted the export-D68644028 branch February 28, 2025 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0